diff options
| author | Ned Deily <nad@acm.org> | 2014-02-13 22:53:42 -0800 |
|---|---|---|
| committer | Ned Deily <nad@acm.org> | 2014-02-13 22:53:42 -0800 |
| commit | b7bb675d3c034c3a46cc485352bbb035f74f47ff (patch) | |
| tree | ec1ee9b8795d20e92aac62d6a6d2e35f1a693429 /Lib | |
| parent | 0714b8b6ab5e13fad0d93128cfcf1955ce7d0514 (diff) | |
| parent | b24f481ab4de08e92f5901391594024b2eff0995 (diff) | |
| download | cpython-git-b7bb675d3c034c3a46cc485352bbb035f74f47ff.tar.gz | |
Issue #20605: Make test_socket getaddrinfo OS X segfault test more robust.
Diffstat (limited to 'Lib')
| -rw-r--r-- | Lib/test/test_socket.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 2f5ed2562f..e94f5396c5 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -1234,9 +1234,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 |
