From 50e033d7d824a24bb98c70f6b8b52160e0180091 Mon Sep 17 00:00:00 2001 From: ocket8888 Date: Tue, 7 Aug 2018 07:49:41 -0600 Subject: [PATCH] Some python versions raise TimeoutError instead of socket.timeout... --- connvitals/ping.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connvitals/ping.py b/connvitals/ping.py index 006d641..a3860f8 100644 --- a/connvitals/ping.py +++ b/connvitals/ping.py @@ -209,7 +209,7 @@ def recv(self) -> float: try: pkt, addr = self.sock.recvfrom(100+len(self.payload)) - except socket.timeout: + except (socket.timeout, TimeoutError): return -1 # The packet must have actually come from the host we pinged