Fix DNS resolution results for IP literals.
This commit is contained in:
parent
e48e50c6ff
commit
4cd5d3b3b5
1 changed files with 2 additions and 2 deletions
|
@ -94,14 +94,14 @@ def resolve(host, port=None, service=None, proto='tcp', resolver=None):
|
|||
try:
|
||||
# If `host` is an IPv4 literal, we can return it immediately.
|
||||
ipv4 = socket.inet_pton(socket.AF_INET, host)
|
||||
yield [(host, port)]
|
||||
yield (host, port)
|
||||
except socket.error:
|
||||
pass
|
||||
|
||||
try:
|
||||
# Likewise, If `host` is an IPv6 literal, we can return it immediately.
|
||||
ipv6 = socket.inet_pton(socket.AF_INET6, host)
|
||||
yield [(host, port)]
|
||||
yield (host, port)
|
||||
except socket.error:
|
||||
pass
|
||||
|
||||
|
|
Loading…
Reference in a new issue