stm32_mem: Guard dfu.dfu_device with try/except.

This commit is contained in:
Uwe Bonnes 2018-03-30 21:37:25 +02:00
parent 667cce7d17
commit 7908ba526b
1 changed files with 4 additions and 1 deletions

View File

@ -89,7 +89,10 @@ def stm32_scan(args, test):
exit(-1) exit(-1)
for dev in devs: for dev in devs:
try:
dfudev = dfu.dfu_device(*dev) dfudev = dfu.dfu_device(*dev)
except:
return 0
man = dfudev.handle.getString(dfudev.dev.iManufacturer, 30) man = dfudev.handle.getString(dfudev.dev.iManufacturer, 30)
if man == "Black Sphere Technologies": bmp = bmp + 1 if man == "Black Sphere Technologies": bmp = bmp + 1
if bmp == 0 : if bmp == 0 :