##// END OF EJS Templates
demandimport: store level argument on _demandmod instances...
demandimport: store level argument on _demandmod instances The 'level' argument to __import__ was added in Python 2.6, and is specified for either relative or absolute imports. The fix introduced in e160f2312815 allowed such imports to proceed without failure, but effectively disabled demandimport for them. This is particularly unfortunate in Python 3.x, where *all* imports are either relative or absolute. The solution introduced here is to store the level argument on the demandimport instance, and propagate it to _origimport() when its value isn't None. Please note that this patch hasn't been tested in Python 3.x, and thus may not be complete. I'm worried about how sub-imports are handled; I don't know what they are, or whether the level argument should be modified for them. I've added 'TODO' notes to these cases; hopefully, someone more knowledgable of these issues will deal with them.
Dan Villiom Podlaski Christiansen -
r11942:50a4e55a default
Show More
Name Size Modified Last Commit Author
contrib
doc
hgext
i18n
mercurial
tests
.hgignore Loading ...
.hgsigs Loading ...
.hgtags Loading ...
CONTRIBUTORS Loading ...
COPYING Loading ...
Makefile Loading ...
README Loading ...
hg Loading ...
hgeditor Loading ...
hgweb.cgi Loading ...
setup.py Loading ...

Basic install:

$ make # see install targets
$ make install # do a system-wide install
$ hg debuginstall # sanity-check setup
$ hg # see help

See http://mercurial.selenic.com/ for detailed installation
instructions, platform-specific notes, and Mercurial user information.