From f20d4f8eadfece1714f40e74541902488887ed34 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sun, 17 Apr 2016 10:31:23 +0200 Subject: [PATCH 1/1] Re-try on TimeoutError on socket connect. --- plomlombot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plomlombot.py b/plomlombot.py index cde978a..61da871 100755 --- a/plomlombot.py +++ b/plomlombot.py @@ -53,7 +53,10 @@ class IO: def __init__(self, server, port, timeout): self.timeout = timeout self.socket = socket.socket() - self.socket.connect((server, port)) + try: + self.socket.connect((server, port)) + except TimeoutError: + raise ExceptionForRestart self.socket.setblocking(0) self.line_buffer = [] self.rune_buffer = "" -- 2.30.2