You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
SDCard: add missing import
This commit is contained in:
@@ -21,14 +21,15 @@ class SDCardManager:
|
||||
print(f"SD card mounted successfully at {mount_point}")
|
||||
return True
|
||||
except OSError as e:
|
||||
errno = -1
|
||||
error_nr = -1
|
||||
try:
|
||||
errno = e.errno
|
||||
error_nr = e.errno
|
||||
except NameError as we:
|
||||
print("Got this weird (sporadic) \"NameError: name 'errno' isn't defined\" again when parsing OSError: {we}")
|
||||
print(f"Original exception: {e}")
|
||||
print(dir(e))
|
||||
if errno == errno.EPERM: # EPERM is 1, meaning already mounted
|
||||
import errno
|
||||
if error_nr == errno.EPERM: # EPERM is 1, meaning already mounted
|
||||
print(f"Got mount error {e} which means already mounted.")
|
||||
return True
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user