]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Get test to pass on S/390. Shout if you think this change is incorrect.
authorNeal Norwitz <nnorwitz@gmail.com>
Sun, 11 Jun 2006 21:38:38 +0000 (21:38 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sun, 11 Jun 2006 21:38:38 +0000 (21:38 +0000)
Lib/test/test_socket.py

index 01b9b5b83884d5d879549a42c134f4e34795ae95..59415aec712e7140de271abc7246a551dd3cd7d3 100644 (file)
@@ -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()