diff options
author | Jos Verlinde <Jos_Verlinde@hotmail.com> | 2025-07-28 16:30:04 +0200 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-08-01 14:52:59 +1000 |
commit | 4ba626ab5a6c47588d25c40ac1dc20d59e33760d (patch) | |
tree | fcc0ff01acd2fbd57bf80838534b5e670cef3973 | |
parent | 953da2080eb9115536101627c7406727c5d44f8b (diff) |
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>
-rw-r--r-- | tools/mpremote/mpremote/mp_errno.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/mpremote/mpremote/mp_errno.py b/tools/mpremote/mpremote/mp_errno.py index 37cb1e0cb..e2554ef1d 100644 --- a/tools/mpremote/mpremote/mp_errno.py +++ b/tools/mpremote/mpremote/mp_errno.py @@ -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 |