Explorar el Código

accept timeout error when checking a closed port

Tobias Fischer hace 2 años
padre
commit
9d25612275
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      nicegui/helpers.py

+ 1 - 1
nicegui/helpers.py

@@ -44,7 +44,7 @@ def is_port_open(host: str, port: int) -> bool:
     sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
     try:
         sock.connect((host, port))
-    except ConnectionRefusedError:
+    except ConnectionRefusedError, TimeoutError:
         return False
     else:
         return True