Cleanup stub imports / caching

This commit is contained in:
Dave Halter
2019-05-05 22:52:48 +02:00
parent cabdb7f032
commit afced5014c
3 changed files with 27 additions and 27 deletions
+3 -3
View File
@@ -324,6 +324,7 @@ class Importer(object):
force_unicode(i.value if isinstance(i, tree.Name) else i)
for i in self.import_path
)
sys_path = self._sys_path_with_modifications()
context_set = [None]
for i, name in enumerate(self.import_path):
@@ -331,9 +332,8 @@ class Importer(object):
self._evaluator.import_module(
import_names[:i+1],
parent_module_context,
self._sys_path_with_modifications(),
)
for parent_module_context in context_set
sys_path
) for parent_module_context in context_set
])
if not context_set:
message = 'No module named ' + '.'.join(import_names)