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
This commit is contained in:
parent
018e3de68b
commit
edc68cf9fb
@ -424,7 +424,7 @@ def _get_yaml_data_and_path(inp: Union[str, Path, Dict]) -> Tuple[Dict, Path]:
|
||||
# (in Windows, it seems OSError [errno.EINVAL] might be raised in some cases)
|
||||
# when trying to expand and resolve it as a path.
|
||||
# Catch this error, but raise any others
|
||||
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user