tools/mpremote: Fix possibly-missing EOPNOTSUPP errno name.
Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
This commit is contained in:
parent
805fe083a3
commit
dc46cf15c1
1 changed files with 4 additions and 1 deletions
|
|
@ -56,7 +56,10 @@ listdir_result = namedtuple("dir_result", ["name", "st_mode", "st_ino", "st_size
|
||||||
# raises it as the corresponding OSError-derived exception.
|
# raises it as the corresponding OSError-derived exception.
|
||||||
def _convert_filesystem_error(e, info):
|
def _convert_filesystem_error(e, info):
|
||||||
if "OSError" in e.error_output:
|
if "OSError" in e.error_output:
|
||||||
for code, estr in errno.errorcode.items():
|
for code, estr in [
|
||||||
|
*errno.errorcode.items(),
|
||||||
|
(errno.EOPNOTSUPP, "EOPNOTSUPP"),
|
||||||
|
]:
|
||||||
if estr in e.error_output:
|
if estr in e.error_output:
|
||||||
return OSError(code, info)
|
return OSError(code, info)
|
||||||
return e
|
return e
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue