1
0
forked from VimPlug/jedi
This commit is contained in:
Maxim Novikov
2018-01-02 19:10:15 +01:00
parent a2031d89b1
commit 7f21fdfbc7

View File

@@ -163,10 +163,15 @@ if the module is contained in a package.
def _iter_modules(paths, prefix=''):
# Copy of pkgutil.iter_modules adapted to work with namespaces
for path in paths:
importer = pkgutil.get_importer(path)
if importer is None or importer.path is None or not os.path.isdir(importer.path):
if not isinstance(importer, importlib.machinery.FileFinder):
yield from pkgutil.iter_modules([path], prefix)
continue
if importer.path is None or not os.path.isdir(importer.path):
return
yielded = {}