From: Christian Heller Date: Sun, 17 Apr 2016 08:31:23 +0000 (+0200) Subject: Re-try on TimeoutError on socket connect. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/static/%7B%7Bprefix%7D%7D/process?a=commitdiff_plain;h=f20d4f8eadfece1714f40e74541902488887ed34;p=plomlombot-irc.git Re-try on TimeoutError on socket connect. --- 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 = ""