diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py index c7b874bf0ce..a46b9fa29ac 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