diff --git a/jedi/evaluate/compiled/mixed.py b/jedi/evaluate/compiled/mixed.py index 2d2b08d4..87ba8d22 100644 --- a/jedi/evaluate/compiled/mixed.py +++ b/jedi/evaluate/compiled/mixed.py @@ -132,7 +132,12 @@ def find_syntax_node_name(evaluator, python_object): # be something like ``email.utils``). return module, path - name_str = python_object.__name__ + try: + name_str = python_object.__name__ + except AttributeError: + # Stuff like python_function.__code__. + return None, None + if name_str == '': return None, None # It's too hard to find lambdas.