mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-04 13:14:32 +02:00
ci: Fix "local variable referenced before assignment" if connecting to DUT fails
This commit is contained in:
committed by
Angus Gratton
parent
dfdf04644f
commit
d3157910e0
@@ -185,6 +185,7 @@ class IDFDUT(DUT.SerialDUT):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def confirm_dut(cls, port, app, **kwargs):
|
def confirm_dut(cls, port, app, **kwargs):
|
||||||
|
inst = None
|
||||||
try:
|
try:
|
||||||
# TODO: check whether 8266 works with this logic
|
# TODO: check whether 8266 works with this logic
|
||||||
# Otherwise overwrite it in ESP8266DUT
|
# Otherwise overwrite it in ESP8266DUT
|
||||||
@@ -195,7 +196,7 @@ class IDFDUT(DUT.SerialDUT):
|
|||||||
except(esptool.FatalError, RuntimeError):
|
except(esptool.FatalError, RuntimeError):
|
||||||
return False
|
return False
|
||||||
finally:
|
finally:
|
||||||
if inst:
|
if inst is not None:
|
||||||
inst._port.close()
|
inst._port.close()
|
||||||
|
|
||||||
@_uses_esptool
|
@_uses_esptool
|
||||||
|
Reference in New Issue
Block a user