diff --git a/tools/pingproxy.py b/tools/pingproxy.py index fb6c4b9..52d76f9 100755 --- a/tools/pingproxy.py +++ b/tools/pingproxy.py @@ -73,7 +73,7 @@ def run(self): self.clients[address].parse(data) except Exception as e: - if hasattr(e, 'errno') and e.errno == errno.EAGAIN: + if isinstance(e, OSError) and e.errno == errno.EAGAIN: pass # waiting for data else: print("Error reading data", e)