mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
tiny-test-fw: handle case when ESPPORT is not set
Fix bug introduced in 8a88dd35
, where .decode was called on result of
os.getenv, which was None if ESPPORT was not set.
This commit is contained in:
parent
3d880f59b9
commit
eb85c4ec15
@ -131,7 +131,11 @@ class IDFDUT(DUT.SerialDUT):
|
||||
@classmethod
|
||||
def list_available_ports(cls):
|
||||
ports = [x.device for x in list_ports.comports()]
|
||||
port_hint = os.getenv('ESPPORT').decode('utf8')
|
||||
espport = os.getenv('ESPPORT')
|
||||
if not espport:
|
||||
return ports
|
||||
|
||||
port_hint = espport.decode('utf8')
|
||||
|
||||
# If $ESPPORT is a valid port, make it appear first in the list
|
||||
if port_hint in ports:
|
||||
|
Loading…
Reference in New Issue
Block a user