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:
parent
953da2080e
commit
4ba626ab5a
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue