##// END OF EJS Templates
demandimport: handling new relative imports...
Ali Gholami Rudi -
r5929:e160f231 default
parent child Browse files
Show More
@@ -77,7 +77,7 b' class _demandmod(object):'
77 77 self._load()
78 78 setattr(self._module, attr, val)
79 79
80 def _demandimport(name, globals=None, locals=None, fromlist=None):
80 def _demandimport(name, globals=None, locals=None, fromlist=None, level=None):
81 81 if not locals or name in ignore or fromlist == ('*',):
82 82 # these cases we can't really delay
83 83 return _origimport(name, globals, locals, fromlist)
@@ -95,6 +95,9 b' def _demandimport(name, globals=None, lo'
95 95 return locals[base]
96 96 return _demandmod(name, globals, locals)
97 97 else:
98 if level is not None:
99 # from . import b,c,d or from .a import b,c,d
100 return _origimport(name, globals, locals, fromlist, level)
98 101 # from a import b,c,d
99 102 mod = _origimport(name, globals, locals)
100 103 # recurse down the module chain
General Comments 0
You need to be logged in to leave comments. Login now