diff --git a/jedi/inference/context.py b/jedi/inference/context.py index ad5f89eb..e0231ef2 100644 --- a/jedi/inference/context.py +++ b/jedi/inference/context.py @@ -298,10 +298,6 @@ class ModuleContext(TreeContextMixin, ValueContext): def py__file__(self): return self._value.py__file__() - @property - def py__package__(self): - return self._value.py__package__ - def is_package(self): return self._value.is_package @@ -391,10 +387,6 @@ class CompiledModuleContext(CompiledContext): def py__file__(self): return self._value.py__file__() - @property - def py__package__(self): - return self._value.py__package__ - def is_package(self): return self._value.is_package() diff --git a/jedi/inference/imports.py b/jedi/inference/imports.py index a2474c7f..35bbf313 100644 --- a/jedi/inference/imports.py +++ b/jedi/inference/imports.py @@ -216,7 +216,7 @@ class Importer(object): self._fixed_sys_path = None self._infer_possible = True if level: - base = module_context.py__package__() + base = module_context.get_value().py__package__() # We need to care for two cases, the first one is if it's a valid # Python import. This import has a properly defined module name # chain like `foo.bar.baz` and an import in baz is made for @@ -553,7 +553,7 @@ def get_module_contexts_containing_name(inference_state, module_contexts, name): used_mod_paths.add(path) folders_with_names_to_be_checked.append(( file_io.get_parent_folder(), - module_context.py__package__() + module_context.get_value().py__package__() )) yield module_context