diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_socket.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index a2de398c80..969677b6a3 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -1202,7 +1202,8 @@ class GeneralModuleTests(unittest.TestCase): self.assertRaises(UnicodeEncodeError, socket.getaddrinfo, 'localhost', '\uD800') # Issue 17269 - socket.getaddrinfo("localhost", None, 0, 0, 0, socket.AI_NUMERICSERV) + if hasattr(socket, 'AI_NUMERICSERV'): + socket.getaddrinfo("localhost", None, 0, 0, 0, socket.AI_NUMERICSERV) def test_getnameinfo(self): # only IP addresses are allowed |