1
0
forked from VimPlug/jedi

An empty path given to Jedi should not raise errors. Fixes #577.

This commit is contained in:
Dave Halter
2016-07-09 17:27:57 +02:00
parent 690241332d
commit 7d64069780
4 changed files with 27 additions and 23 deletions

View File

@@ -852,7 +852,8 @@ class ModuleWrapper(use_metaclass(CachedMetaClass, tree.Module, Wrapper)):
def _get_init_directory(self):
for suffix, _, _ in imp.get_suffixes():
ending = '__init__' + suffix
if self.py__file__().endswith(ending):
py__file__ = self.py__file__()
if py__file__ is not None and py__file__.endswith(ending):
# Remove the ending, including the separator.
return self.py__file__()[:-len(ending) - 1]
return None