Commit 6b5a38c7 authored by Antoine Pitrou's avatar Antoine Pitrou

Fix test_bad_address on Ubuntu 13.04

parent 3b08a297
...@@ -116,7 +116,10 @@ class urlopenNetworkTests(unittest.TestCase): ...@@ -116,7 +116,10 @@ class urlopenNetworkTests(unittest.TestCase):
bogus_domain = "sadflkjsasf.i.nvali.d" bogus_domain = "sadflkjsasf.i.nvali.d"
try: try:
socket.gethostbyname(bogus_domain) 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 pass
else: else:
# This happens with some overzealous DNS providers such as OpenDNS # This happens with some overzealous DNS providers such as OpenDNS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment