summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-11-26 08:28:05 (GMT)
committerGeorg Brandl <georg@python.org>2010-11-26 08:28:05 (GMT)
commitb727650e0cc89ffccaf99de46d715bd33ff3b400 (patch)
tree2bf3eba728a93b8434774c023cb175831e24bc50 /Lib/test/test_socket.py
parent0a8e5626ad8d007c25826ad3cd7c0ceea67dc462 (diff)
downloadcpython-b727650e0cc89ffccaf99de46d715bd33ff3b400.zip
cpython-b727650e0cc89ffccaf99de46d715bd33ff3b400.tar.gz
cpython-b727650e0cc89ffccaf99de46d715bd33ff3b400.tar.bz2
Merged revisions 86561-86562,86564-86565,86705,86708,86713 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86561 | georg.brandl | 2010-11-20 12:47:10 +0100 (Sa, 20 Nov 2010) | 1 line #10460: Update indent.pro to match PEP 7 better. ........ r86562 | georg.brandl | 2010-11-20 14:44:41 +0100 (Sa, 20 Nov 2010) | 1 line #10439: document PyCodec C APIs. ........ r86564 | georg.brandl | 2010-11-20 15:08:53 +0100 (Sa, 20 Nov 2010) | 1 line #10460: an even better indent.pro. ........ r86565 | georg.brandl | 2010-11-20 15:16:17 +0100 (Sa, 20 Nov 2010) | 1 line socket.gethostbyname(socket.gethostname()) can fail when host name resolution is not set up correctly; do not fail test_socket if this is the case. ........ r86705 | georg.brandl | 2010-11-23 08:54:19 +0100 (Di, 23 Nov 2010) | 1 line #10468: document Unicode exception creation and access functions. ........ r86708 | georg.brandl | 2010-11-23 09:37:54 +0100 (Di, 23 Nov 2010) | 2 lines #10511: clarification of what heaps are; suggested by Johannes Hoff. ........ r86713 | georg.brandl | 2010-11-23 19:14:57 +0100 (Di, 23 Nov 2010) | 1 line assert.h is also included. Thanks to Savio Sena. ........
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r--Lib/test/test_socket.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 0cf57bd..d41bca5 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -523,7 +523,11 @@ class GeneralModuleTests(unittest.TestCase):
# XXX(nnorwitz): http://tinyurl.com/os5jz seems to indicate
# it reasonable to get the host's addr in addition to 0.0.0.0.
# At least for eCos. This is required for the S/390 to pass.
- my_ip_addr = socket.gethostbyname(socket.gethostname())
+ try:
+ my_ip_addr = socket.gethostbyname(socket.gethostname())
+ except socket.error:
+ # Probably name lookup wasn't set up right; skip this test
+ return
self.assertIn(name[0], ("0.0.0.0", my_ip_addr), '%s invalid' % name[0])
self.assertEqual(name[1], port)