home · contact · privacy
Re-try on TimeoutError on socket connect.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 17 Apr 2016 08:31:23 +0000 (10:31 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 17 Apr 2016 08:31:23 +0000 (10:31 +0200)
plomlombot.py

index cde978a..61da871 100755 (executable)
@@ -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 = ""