From 4f840d4c212a13e4e7c025c10cd0f6fbce62a4bd Mon Sep 17 00:00:00 2001 From: boyska Date: Tue, 18 Sep 2018 12:33:20 +0200 Subject: [PATCH] FIX dbprepare: wait_net_service exceptions --- dodo_utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dodo_utils.py b/dodo_utils.py index 66734db..66e3165 100644 --- a/dodo_utils.py +++ b/dodo_utils.py @@ -34,10 +34,12 @@ def wait_net_service(server, port, timeout=None): # this exception occurs only if timeout is set if timeout: return False + except (ConnectionRefusedError, ConnectionAbortedError): + pass except socket.error as err: # catch timeout exception from underlying network library # this one is different from socket.timeout - if type(err.args) != tuple or err[0] != errno.ETIMEDOUT: + if type(err.args) != tuple or err.errno != errno.ETIMEDOUT: raise else: s.close()