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()