1
0
Fork 0

fix that bug

This commit is contained in:
khr 2020-04-02 21:54:01 -07:00
parent b8aa7dd1e8
commit fb9257917c
1 changed files with 2 additions and 2 deletions

View File

@ -64,7 +64,7 @@ class SocketWrapper:
LOG.debug("Connecting to {}:{}".format(self.host, self.port))
self.soc = _try_with_backoff(
lambda: socket.create_connection((self.host, self.port)),
lambda e: e is OSError and e.errno == 111,
lambda e: isinstance(e, OSError) and e.errno == 111,
)
LOG.info("Socket Connected")
@ -72,7 +72,7 @@ class SocketWrapper:
LOG.info("Server Binding to {}:{}".format(self.host, self.port))
self.soc = _try_with_backoff(
lambda: socket_create_server((self.host, self.port)),
lambda e: e is OSError and e.errno == 98,
lambda e: isinstance(e, OSError) and e.errno == 98,
)
LOG.info("Server Bound")