summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2014-02-14 06:50:42 (GMT)
committerNed Deily <nad@acm.org>2014-02-14 06:50:42 (GMT)
commitb24f481ab4de08e92f5901391594024b2eff0995 (patch)
treede9b979d0e79bdcf44e9cb0ce1d46cec578d5677 /Lib/test/test_socket.py
parentffadbb7ee7ff770d818607f6c03ef6c37a177a6f (diff)
downloadcpython-b24f481ab4de08e92f5901391594024b2eff0995.zip
cpython-b24f481ab4de08e92f5901391594024b2eff0995.tar.gz
cpython-b24f481ab4de08e92f5901391594024b2eff0995.tar.bz2
Issue #20605: Make test_socket getaddrinfo OS X segfault test more robust.
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r--Lib/test/test_socket.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 67ff1be..450aee1 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -1164,9 +1164,15 @@ class GeneralModuleTests(unittest.TestCase):
# Issue #6697.
self.assertRaises(UnicodeEncodeError, socket.getaddrinfo, 'localhost', '\uD800')
- # Issue 17269
+ # Issue 17269: test workaround for OS X platform bug segfault
if hasattr(socket, 'AI_NUMERICSERV'):
- socket.getaddrinfo("localhost", None, 0, 0, 0, socket.AI_NUMERICSERV)
+ try:
+ # The arguments here are undefined and the call may succeed
+ # or fail. All we care here is that it doesn't segfault.
+ socket.getaddrinfo("localhost", None, 0, 0, 0,
+ socket.AI_NUMERICSERV)
+ except socket.gaierror:
+ pass
def test_getnameinfo(self):
# only IP addresses are allowed