stm32_mem: Guard dfu.dfu_device with try/except.
This commit is contained in:
parent
667cce7d17
commit
7908ba526b
|
@ -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 :
|
||||||
|
|
Loading…
Reference in New Issue