소스 검색

accept timeout error when checking a closed port

Tobias Fischer 2 년 전
부모
커밋
9d25612275
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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