summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2008-03-28 06:34:03 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2008-03-28 06:34:03 (GMT)
commit70cea58c84165460683b12e60331b4a90550e313 (patch)
treed7f3585e0f74f57831f766f633eb75a04a52a475
parent9fdfaaf9af621d45c849061ea05bd3f2c37232c8 (diff)
downloadcpython-70cea58c84165460683b12e60331b4a90550e313.zip
cpython-70cea58c84165460683b12e60331b4a90550e313.tar.gz
cpython-70cea58c84165460683b12e60331b4a90550e313.tar.bz2
Bug 1503: Get the test to pass on OSX. This should make the test more
reliable, but I'm not convinced it is the right solution. We need to determine if this causes the test to hang on any platforms or do other bad things. Even if it gets the test to pass reliably, it might be that we want to fix this in socket. The socket returned from accept() is different on different platforms (inheriting attributes or not) and we might want to ensure that the attributes (at least blocking) is the same across all platforms.
-rw-r--r--Lib/test/test_xmlrpc.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py
index c7b874b..a46b9fa 100644
--- a/Lib/test/test_xmlrpc.py
+++ b/Lib/test/test_xmlrpc.py
@@ -273,9 +273,17 @@ def http_server(evt, numrequests):
'''This is my function'''
return True
+ class MyXMLRPCServer(SimpleXMLRPCServer.SimpleXMLRPCServer):
+ def get_request(self):
+ # Ensure the socket is always non-blocking. On Linux, socket
+ # attributes are not inherited like they are on *BSD and Windows.
+ s, port = self.socket.accept()
+ s.setblocking(True)
+ return s, port
+
try:
- serv = SimpleXMLRPCServer.SimpleXMLRPCServer(("localhost", 0),
- logRequests=False, bind_and_activate=False)
+ serv = MyXMLRPCServer(("localhost", 0),
+ logRequests=False, bind_and_activate=False)
serv.socket.settimeout(3)
serv.server_bind()
global PORT