#8853: Allow port to be of type long for socket.getaddrinfo()

This commit is contained in:
Petri Lehtinen 2012-12-20 21:06:14 +02:00
parent 92014420d7
commit ab7dd183f3
3 changed files with 11 additions and 4 deletions

View file

@ -644,9 +644,10 @@ class GeneralModuleTests(unittest.TestCase):
if SUPPORTS_IPV6:
socket.getaddrinfo('::1', 80)
# port can be a string service name such as "http", a numeric
# port number or None
# port number (int or long), or None
socket.getaddrinfo(HOST, "http")
socket.getaddrinfo(HOST, 80)
socket.getaddrinfo(HOST, 80L)
socket.getaddrinfo(HOST, None)
# test family and socktype filters
infos = socket.getaddrinfo(HOST, None, socket.AF_INET)