The import logic cannot assume that a file is always importable, fixes #716.

This commit is contained in:
Dave Halter
2016-07-06 08:52:23 +02:00
parent 4243adf54b
commit 3ad159b0aa

View File

@@ -346,6 +346,11 @@ class Importer(object):
else:
module = _load_module(self._evaluator, module_path, source, sys_path)
if module is None:
# The file might raise an ImportError e.g. and therefore not be
# importable.
return set()
self._evaluator.modules[module_name] = module
return set([module])