tools/mpremote: Handle FileNotFound exceptions in listdir.
The except handler for OSError didn't include the line that actually calls os.listdir, so an invalid path wasn't handled correctly. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
parent
7775523b2d
commit
3427e12e8f
|
@ -428,12 +428,11 @@ class PyboardCommand:
|
||||||
path = self.root + self.rd_str()
|
path = self.root + self.rd_str()
|
||||||
try:
|
try:
|
||||||
self.path_check(path)
|
self.path_check(path)
|
||||||
|
self.data_ilistdir[0] = path
|
||||||
|
self.data_ilistdir[1] = os.listdir(path)
|
||||||
self.wr_s8(0)
|
self.wr_s8(0)
|
||||||
except OSError as er:
|
except OSError as er:
|
||||||
self.wr_s8(-abs(er.errno))
|
self.wr_s8(-abs(er.errno))
|
||||||
else:
|
|
||||||
self.data_ilistdir[0] = path
|
|
||||||
self.data_ilistdir[1] = os.listdir(path)
|
|
||||||
|
|
||||||
def do_ilistdir_next(self):
|
def do_ilistdir_next(self):
|
||||||
if self.data_ilistdir[1]:
|
if self.data_ilistdir[1]:
|
||||||
|
|
Loading…
Reference in New Issue