mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 05:54:25 +08:00
Catch an OSError on Windows
This commit is contained in:
@@ -191,8 +191,15 @@ def _find_syntax_node_name(inference_state, python_object):
|
||||
# The type might not be known (e.g. class_with_dict.__weakref__)
|
||||
return None
|
||||
path = None if path is None else Path(path)
|
||||
if path is None or not path.exists():
|
||||
# The path might not exist or be e.g. <stdin>.
|
||||
try:
|
||||
if path is None or not path.exists():
|
||||
# The path might not exist or be e.g. <stdin>.
|
||||
return None
|
||||
except OSError:
|
||||
# Might raise an OSError on Windows:
|
||||
#
|
||||
# [WinError 123] The filename, directory name, or volume label
|
||||
# syntax is incorrect: '<string>'
|
||||
return None
|
||||
|
||||
file_io = FileIO(path)
|
||||
|
||||
Reference in New Issue
Block a user