Explorar el Código

gw update: Fix crash when attempting to reopen GW USB devce

Keir Fraser hace 4 años
padre
commit
4570337169
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      scripts/greaseweazle/tools/util.py

+ 1 - 1
scripts/greaseweazle/tools/util.py

@@ -65,7 +65,7 @@ def find_port(old_port=None):
         for x in serial.tools.list_ports.comports():
             if x.location and x.location == old_port.location:
                 return x.device
-        return None
+        raise serial.SerialException('Could not reopen Greaseweazle device')
     # Score each serial port
     best_score, best_port = 0, None
     for x in serial.tools.list_ports.comports():