Explorar o código

accept timeout error when checking a closed port

Tobias Fischer %!s(int64=2) %!d(string=hai) anos
pai
achega
9d25612275
Modificáronse 1 ficheiros con 1 adicións e 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