tools/mpremote: Fix possibly-missing EOPNOTSUPP errno name.

Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
This commit is contained in:
Anson Mansfield 2025-04-07 13:52:57 -04:00 committed by Damien George
parent 805fe083a3
commit dc46cf15c1

View file

@ -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