Răsfoiți Sursa

accept timeout error when checking a closed port

Tobias Fischer 2 ani în urmă
părinte
comite
9d25612275
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  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