Skip to content

Commit dd2371d

Browse files
SDCard: add missing import
1 parent 9e6f32b commit dd2371d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

internal_filesystem/lib/mpos/sdcard.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ def _try_mount(self, mount_point):
2121
print(f"SD card mounted successfully at {mount_point}")
2222
return True
2323
except OSError as e:
24-
errno = -1
24+
error_nr = -1
2525
try:
26-
errno = e.errno
26+
error_nr = e.errno
2727
except NameError as we:
2828
print("Got this weird (sporadic) \"NameError: name 'errno' isn't defined\" again when parsing OSError: {we}")
2929
print(f"Original exception: {e}")
3030
print(dir(e))
31-
if errno == errno.EPERM: # EPERM is 1, meaning already mounted
31+
import errno
32+
if error_nr == errno.EPERM: # EPERM is 1, meaning already mounted
3233
print(f"Got mount error {e} which means already mounted.")
3334
return True
3435
else:

0 commit comments

Comments
 (0)