1
0
forked from VimPlug/jedi

If the stub module is not a package but the actual module is, it should not fail the import

This commit is contained in:
Dave Halter
2018-12-09 13:39:40 +01:00
parent 3ec194093d
commit aa4846bff6
2 changed files with 6 additions and 2 deletions

View File

@@ -172,7 +172,7 @@ class ModuleContext(ModuleMixin, TreeContext):
return os.path.abspath(self._path)
def _is_package(self):
def is_package(self):
return self._get_init_directory() is not None
def py__package__(self):
@@ -218,7 +218,7 @@ class ModuleContext(ModuleMixin, TreeContext):
is a list of paths (strings).
Raises an AttributeError if the module is not a package.
"""
if self._is_package():
if self.is_package():
return self._py__path__
else:
raise AttributeError('Only packages have __path__ attributes.')