fix: really fix get_address_info

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
sammachin-gprs
Alan Shaw 2018-09-02 11:56:22 +01:00
parent d430751202
commit 958104e090
No known key found for this signature in database
GPG Key ID: 101D1B7A03DFAD4C
1 changed files with 1 additions and 4 deletions

View File

@ -199,10 +199,7 @@ def open_http_socket(method, url, json=None, timeout=None, headers=None, data=No
def get_address_info(host, port, retries_left = 20):
try:
if is_ipv4_address(host):
return (host, port)
else:
return usocket.getaddrinfo(host, port)[0][4]
return usocket.getaddrinfo(host, port)[0][4]
except OSError as e:
if ("-15" in str(e)) and retries_left:
# [addrinfo error -15]