summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllibnet.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-05-25 11:08:34 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2013-05-25 11:08:34 (GMT)
commit765f3cce4891ad1e00f809070c3e8d11e85a8a56 (patch)
tree4f5936df44a5a0cc0fc0303b6ab802256b6e8ef2 /Lib/test/test_urllibnet.py
parent3a65ad7f0858f13b1f2599f029cb42f11c496132 (diff)
parent6b5a38c728bbca3273b6917308559cf22e298531 (diff)
downloadcpython-765f3cce4891ad1e00f809070c3e8d11e85a8a56.zip
cpython-765f3cce4891ad1e00f809070c3e8d11e85a8a56.tar.gz
cpython-765f3cce4891ad1e00f809070c3e8d11e85a8a56.tar.bz2
Fix test_bad_address on Ubuntu 13.04
Diffstat (limited to 'Lib/test/test_urllibnet.py')
-rw-r--r--Lib/test/test_urllibnet.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_urllibnet.py b/Lib/test/test_urllibnet.py
index 896d7c9..b6888f3 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