Fixed "UnboundLocalError: local variable 'port' referenced before assignment" // Resolve #4407

This commit is contained in:
Ivan Kravets
2022-09-03 12:08:17 +03:00
parent af21c50aec
commit e0a3b81877

View File

@ -149,7 +149,7 @@ class SerialPortFinder:
port = self._reveal_device_port(device) port = self._reveal_device_port(device)
# pick the best PID:VID USB device # pick the best PID:VID USB device
best_port = None port = best_port = None
for item in list_serial_ports(): for item in list_serial_ports():
if self.ensure_ready and not is_serial_port_ready(item["port"]): if self.ensure_ready and not is_serial_port_ready(item["port"]):
continue continue