Skip to content

Commit 4ba626a

Browse files
Josverldpgeorge
authored andcommitted
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 micropython#17773. Signed-off-by: Jos Verlinde <[email protected]>
1 parent 953da20 commit 4ba626a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/mpremote/mpremote/mp_errno.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import errno
2+
import platform
23

34
# This table maps numeric values defined by `py/mperrno.h` to host errno code.
45
MP_ERRNO_TABLE = {
@@ -16,7 +17,6 @@
1617
12: errno.ENOMEM,
1718
13: errno.EACCES,
1819
14: errno.EFAULT,
19-
15: errno.ENOTBLK,
2020
16: errno.EBUSY,
2121
17: errno.EEXIST,
2222
18: errno.EXDEV,
@@ -51,3 +51,5 @@
5151
115: errno.EINPROGRESS,
5252
125: errno.ECANCELED,
5353
}
54+
if platform.system() != "Windows":
55+
MP_ERRNO_TABLE[15] = errno.ENOTBLK

0 commit comments

Comments
 (0)