Specify a non-zero port when testing localhost resolution.
Some getaddrinfo implementations (including OS X 10.6) fail if we try to resolve port 0 without AI_PASSIVE. Closes #1136.
This commit is contained in:
parent
93ae079795
commit
afea02e18d
|
@ -72,7 +72,9 @@ class TCPClientTest(AsyncTestCase):
|
|||
super(TCPClientTest, self).tearDown()
|
||||
|
||||
def skipIfLocalhostV4(self):
|
||||
Resolver().resolve('localhost', 0, callback=self.stop)
|
||||
# The port used here doesn't matter, but some systems require it
|
||||
# to be non-zero if we do not also pass AI_PASSIVE.
|
||||
Resolver().resolve('localhost', 80, callback=self.stop)
|
||||
addrinfo = self.wait()
|
||||
families = set(addr[0] for addr in addrinfo)
|
||||
if socket.AF_INET6 not in families:
|
||||
|
|
Loading…
Reference in New Issue