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.
This commit is contained in:
JensDiemer 2020-01-09 16:33:31 +01:00 committed by Damien George
parent 4ab4bf3ec6
commit c14ff6194c
1 changed files with 5 additions and 5 deletions

View File

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