diff --git a/jedi/inference/gradual/stub_value.py b/jedi/inference/gradual/stub_value.py index c2e2bc4e..22f08a10 100644 --- a/jedi/inference/gradual/stub_value.py +++ b/jedi/inference/gradual/stub_value.py @@ -86,6 +86,8 @@ class StubFilter(ParserTreeFilter): # Imports in stub files are only public if they have an "as" # export. definition = name.get_definition() + if definition is None: + return False if definition.type in ('import_from', 'import_name'): if name.parent.type not in ('import_as_name', 'dotted_as_name'): return False diff --git a/jedi/inference/value/klass.py b/jedi/inference/value/klass.py index ee8d4e85..6ff1698c 100644 --- a/jedi/inference/value/klass.py +++ b/jedi/inference/value/klass.py @@ -78,6 +78,8 @@ class ClassName(TreeNameDefinition): type_ = super().api_type if type_ == 'function': definition = self.tree_name.get_definition() + if definition is None: + return type_ if function_is_property(definition): # This essentially checks if there is an @property before # the function. @property could be something different, but