From 7f21fdfbc791cc97b3ee1399ed2a3dde1dc81d15 Mon Sep 17 00:00:00 2001 From: Maxim Novikov Date: Tue, 2 Jan 2018 19:10:15 +0100 Subject: [PATCH] Fallback --- jedi/_compatibility.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jedi/_compatibility.py b/jedi/_compatibility.py index ab00f7d2..2a662f32 100644 --- a/jedi/_compatibility.py +++ b/jedi/_compatibility.py @@ -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 = {}