diff --git a/jedi/evaluate/compiled/__init__.py b/jedi/evaluate/compiled/__init__.py index 3ab487e9..962d3dbf 100644 --- a/jedi/evaluate/compiled/__init__.py +++ b/jedi/evaluate/compiled/__init__.py @@ -40,6 +40,7 @@ class CompiledObject(Base): # comply with the parser start_pos = 0, 0 path = None # modules have this attribute - set it to None. + used_names = {} # To be consistent with modules. def __init__(self, obj, parent=None): self.obj = obj diff --git a/test/static_analysis/attribute_error.py b/test/static_analysis/attribute_error.py index 7ceb9397..4b084c11 100644 --- a/test/static_analysis/attribute_error.py +++ b/test/static_analysis/attribute_error.py @@ -111,3 +111,9 @@ import import_tree import_tree.a import_tree.b + +# This is something that raised an error, because it was using a complex +# mixture of Jedi fakes and compiled objects. +import _sre +#! 15 attribute-error +_sre.compile().not_existing