8000 fs_driver.py: bugfix · wired8/lv_binding_micropython@f7b5e7f · GitHub
[go: up one dir, main page]

Skip to content

Commit f7b5e7f

Browse files
committed
fs_driver.py: bugfix
If errno is missing in uerrno.errorcode, show the errno number.
1 parent 75988b6 commit f7b5e7f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/fs_driver.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ def fs_open_cb(drv, path, mode):
2121
f = open(path, p_mode)
2222

2323
except Exception as e:
24-
raise RuntimeError("fs_open_callback(%s) exception: " % (path), uerrno.errorcode[e.args[0]])
24+
errno = e.args[0]
25+
raise RuntimeError("fs_open_callback(%s) exception: " % (path), uerrno.errorcode.get(errno, str(errno)))
2526

2627
return {'file' : f}
2728

0 commit comments

Comments
 (0)
0