From cbd3a8a59a5375e5b84a34d1e960e4476c2b0a94 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Tue, 28 Apr 2015 02:30:32 +0200 Subject: [PATCH] Restructured loading of compiled __init__ files. --- jedi/evaluate/compiled/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jedi/evaluate/compiled/__init__.py b/jedi/evaluate/compiled/__init__.py index 79ecb756..609da711 100644 --- a/jedi/evaluate/compiled/__init__.py +++ b/jedi/evaluate/compiled/__init__.py @@ -318,6 +318,10 @@ def dotted_from_fs_path(fs_path, sys_path=None): if sys_path is None: sys_path = get_sys_path() + if os.path.basename(fs_path).startswith('__init__.'): + # We are calculating the path. __init__ files are not interesting. + fs_path = os.path.dirname(fs_path) + # prefer # - UNIX # /path/to/pythonX.Y/lib-dynload