Skip to content

Commit 40779ab

Browse files
sdcard.py: cleanup
1 parent a22a553 commit 40779ab

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

internal_filesystem/lib/mpos/sdcard.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,8 @@ 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-
error_nr = -1
25-
try:
26-
error_nr = e.errno
27-
except NameError as we:
28-
print("Got this weird (sporadic) \"NameError: name 'errno' isn't defined\" again when parsing OSError: {we}")
29-
print(f"Original exception: {e}")
30-
print(dir(e))
3124
import errno
32-
if error_nr == errno.EPERM: # EPERM is 1, meaning already mounted
25+
if e.errno == errno.EPERM: # EPERM is 1, meaning already mounted
3326
print(f"Got mount error {e} which means already mounted.")
3427
return True
3528
else:

0 commit comments

Comments
 (0)