summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-06-11 21:38:38 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-06-11 21:38:38 (GMT)
commit4a9ff1626a17dd7cb1bf58c017d22678a6532dcf (patch)
tree1db01a9fe017054ee55e9c547bf1e7a6e1567745 /Lib/test/test_socket.py
parent06524b61d05c604543e6d3603dee11425ccff637 (diff)
downloadcpython-4a9ff1626a17dd7cb1bf58c017d22678a6532dcf.zip
cpython-4a9ff1626a17dd7cb1bf58c017d22678a6532dcf.tar.gz
cpython-4a9ff1626a17dd7cb1bf58c017d22678a6532dcf.tar.bz2
Get test to pass on S/390. Shout if you think this change is incorrect.
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r--Lib/test/test_socket.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 01b9b5b..59415ae 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -447,7 +447,12 @@ class GeneralModuleTests(unittest.TestCase):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(("0.0.0.0", PORT+1))
name = sock.getsockname()
- self.assertEqual(name, ("0.0.0.0", PORT+1))
+ # 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())
+ self.assert_(name[0] in ("0.0.0.0", my_ip_addr), '%s invalid' % name[0])
+ self.assertEqual(name[1], PORT+1)
def testGetSockOpt(self):
# Testing getsockopt()