diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2013-05-25 13:08:13 +0200 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2013-05-25 13:08:13 +0200 |
commit | 4e34e5b9557b9ba5789a9465bbf1ed6bb1a9069c (patch) | |
tree | afbfe1aad76cdcfba2ce830f86c2ac75207610ae /Lib/test | |
parent | fc265c4d308fee000e3e09a6f775647f6cab68e3 (diff) | |
download | cpython-4e34e5b9557b9ba5789a9465bbf1ed6bb1a9069c.tar.gz |
Fix test_bad_address on Ubuntu 13.04
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_urllibnet.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_urllibnet.py b/Lib/test/test_urllibnet.py index d3fe69dbce..20efca6adb 100644 --- a/Lib/test/test_urllibnet.py +++ b/Lib/test/test_urllibnet.py @@ -116,7 +116,10 @@ class urlopenNetworkTests(unittest.TestCase): bogus_domain = "sadflkjsasf.i.nvali.d" try: socket.gethostbyname(bogus_domain) - except socket.gaierror: + except OSError: + # socket.gaierror is too narrow, since getaddrinfo() may also + # fail with EAI_SYSTEM and ETIMEDOUT (seen on Ubuntu 13.04), + # i.e. Python's TimeoutError. pass else: # This happens with some overzealous DNS providers such as OpenDNS |