Show More
@@ -81,7 +81,10 b' class _demandmod(object):' | |||||
81 | def _demandimport(name, globals=None, locals=None, fromlist=None, level=None): |
|
81 | def _demandimport(name, globals=None, locals=None, fromlist=None, level=None): | |
82 | if not locals or name in ignore or fromlist == ('*',): |
|
82 | if not locals or name in ignore or fromlist == ('*',): | |
83 | # these cases we can't really delay |
|
83 | # these cases we can't really delay | |
84 | return _origimport(name, globals, locals, fromlist) |
|
84 | if level is None: | |
|
85 | return _origimport(name, globals, locals, fromlist) | |||
|
86 | else: | |||
|
87 | return _origimport(name, globals, locals, fromlist, level) | |||
85 | elif not fromlist: |
|
88 | elif not fromlist: | |
86 | # import a [as b] |
|
89 | # import a [as b] | |
87 | if '.' in name: # a.b |
|
90 | if '.' in name: # a.b |
General Comments 0
You need to be logged in to leave comments.
Login now