Commit 05241e83 authored by Denis Bilenko's avatar Denis Bilenko

socket: fix connect_ex() to use gethostbyname() too

parent 4e2b5cbf
......@@ -294,6 +294,8 @@ class socket(object):
wait_write(fd.fileno(), timeout=end-time.time())
def connect_ex(self, address):
if isinstance(address, tuple) and len(address)==2:
address = gethostbyname(address[0]), address[1]
if self.timeout == 0.0:
return self.fd.connect_ex(address)
fd = self.fd
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment