

def make_server(self, addr, svrcls, hdlrbase):

    class MyServer(svrcls):

        def handle_error(self, request, client_address):
            self.close_request(request)
            self.server_close()
            raise

    class MyHandler(hdlrbase):

        def handle(self):
            line = self.rfile.readline()
            self.wfile.write(line)
    if verbose:
        print('creating server')
    server = MyServer(addr, MyHandler)
    self.assertEqual(server.server_address, server.socket.getsockname())
    return server

dataset/ETHPy150Open amrdraz/kodr/app/brython/www/src/Lib/test/test_socketserver.py SocketServerTest.make_server/original