Merge branch 'bugfix/tinytestfw_espport' into 'master'

tiny-test-fw: handle case when ESPPORT is not set

See merge request idf/esp-idf!2684
This commit is contained in:
Angus Gratton 2018-07-03 09:10:12 +08:00
commit 05a5c58f7a

View file

@ -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: