1
0
forked from VimPlug/jedi

inspect now raises OSError for objects without source file

CPython issue: https://bugs.python.org/issue44648
This commit is contained in:
Lumír 'Frenzy' Balhar
2021-08-05 08:24:35 +02:00
committed by Lumir Balhar
parent 1d944943c3
commit eab1b8be8b
2 changed files with 22 additions and 1 deletions

View File

@@ -187,7 +187,7 @@ def _find_syntax_node_name(inference_state, python_object):
try:
python_object = _get_object_to_check(python_object)
path = inspect.getsourcefile(python_object)
except TypeError:
except (OSError, TypeError):
# The type might not be known (e.g. class_with_dict.__weakref__)
return None
path = None if path is None else Path(path)