esp8266/modules: Fix AttributeError in _boot.py if flash not formatted.

Prior to this commit, if the flash filesystem was not formatted then it
would error: "AttributeError: 'FlashBdev' object has no attribute 'mount'".
That is due to it not being able to detect the filesystem on the block
device and just trying to mount the block device directly.

This commit fixes the issue by just catching all exceptions.  Also it's not
needed to try the mount if `flashbdev.bdev` is None.
pull/5553/head
JensDiemer 2020-01-09 16:33:31 +01:00 zatwierdzone przez Damien George
rodzic 4ab4bf3ec6
commit c14ff6194c
1 zmienionych plików z 5 dodań i 5 usunięć

Wyświetl plik

@ -3,11 +3,11 @@ gc.threshold((gc.mem_free() + gc.mem_alloc()) // 4)
import uos
from flashbdev import bdev
try:
if bdev:
if bdev:
try:
uos.mount(bdev, '/')
except OSError:
import inisetup
inisetup.setup()
except:
import inisetup
inisetup.setup()
gc.collect()