Skip to content

Commit

Permalink
Catch OSError also with errno=None (#392)
Browse files Browse the repository at this point in the history
In Windows might OSError(errno = None) be raised instead of the already
catched exceptions in some cases (depending on the Python version)

Fixes #391
  • Loading branch information
martinrieder authored and kvid committed Jul 5, 2024
1 parent 858b266 commit 42d10df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wireviz/wireviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def _get_yaml_data_and_path(inp: Union[str, Path, Dict]) -> (Dict, Path):
# Catch this error, but raise any others
from errno import EINVAL, ENAMETOOLONG

if type(e) is OSError and e.errno not in (EINVAL, ENAMETOOLONG):
if type(e) is OSError and e.errno not in (EINVAL, ENAMETOOLONG, None):
raise e
# file does not exist; assume inp is a YAML string
yaml_str = inp
Expand Down

0 comments on commit 42d10df

Please sign in to comment.