Archived
2
0
Fork 0
forked from blallo/Feedati

FIX dbprepare: wait_net_service exceptions

This commit is contained in:
boyska 2018-09-18 12:33:20 +02:00
parent ab4d837936
commit 4f840d4c21

View file

@ -34,10 +34,12 @@ def wait_net_service(server, port, timeout=None):
# this exception occurs only if timeout is set # this exception occurs only if timeout is set
if timeout: if timeout:
return False return False
except (ConnectionRefusedError, ConnectionAbortedError):
pass
except socket.error as err: except socket.error as err:
# catch timeout exception from underlying network library # catch timeout exception from underlying network library
# this one is different from socket.timeout # 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 raise
else: else:
s.close() s.close()