Browse Source

accept timeout error when checking a closed port

Tobias Fischer 2 năm trước cách đây
mục cha
commit
9d25612275
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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