Fix DNS resolution results for IP literals.

This commit is contained in:
Lance Stout 2012-04-10 14:08:33 -04:00
parent e48e50c6ff
commit 4cd5d3b3b5

View file

@ -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