mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-27 23:51:26 +08:00
The import logic cannot assume that a file is always importable, fixes #716.
This commit is contained in:
@@ -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])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user