Skip to content

Commit edc68cf

Browse files
martinrieder17o2
authored andcommitted
Catch OSError also with errno=None (#392)
In Windows might OSError(errno = None) be raised instead of the already catched exceptions in some cases (depending on the Python version) Fixes #391
1 parent 018e3de commit edc68cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wireviz/wireviz.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ def _get_yaml_data_and_path(inp: Union[str, Path, Dict]) -> Tuple[Dict, Path]:
424424
# (in Windows, it seems OSError [errno.EINVAL] might be raised in some cases)
425425
# when trying to expand and resolve it as a path.
426426
# Catch this error, but raise any others
427-
if type(e) is OSError and e.errno not in (EINVAL, ENAMETOOLONG):
427+
if type(e) is OSError and e.errno not in (EINVAL, ENAMETOOLONG, None):
428428
raise e
429429
# file does not exist; assume inp is a YAML string
430430
yaml_str = inp

0 commit comments

Comments
 (0)