tools/mpremote: Fix errno.ENOTBLK attribute error on Windows.

Not all errors defined in stdlib errno are available on Windows.
Specifically, errno.ENOTBLK is not.

Fixes issue #17773.

Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
This commit is contained in:
Jos Verlinde 2025-07-28 16:30:04 +02:00 committed by Damien George
parent 953da2080e
commit 4ba626ab5a

View file

@ -1,4 +1,5 @@
import errno
import platform
# This table maps numeric values defined by `py/mperrno.h` to host errno code.
MP_ERRNO_TABLE = {
@ -16,7 +17,6 @@ MP_ERRNO_TABLE = {
12: errno.ENOMEM,
13: errno.EACCES,
14: errno.EFAULT,
15: errno.ENOTBLK,
16: errno.EBUSY,
17: errno.EEXIST,
18: errno.EXDEV,
@ -51,3 +51,5 @@ MP_ERRNO_TABLE = {
115: errno.EINPROGRESS,
125: errno.ECANCELED,
}
if platform.system() != "Windows":
MP_ERRNO_TABLE[15] = errno.ENOTBLK