summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
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)