From 9faf8bedd74f7773d01109f688b6b7ffa8a324ab Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 24 Jan 2007 14:24:55 -0500 Subject: [PATCH] Fix GlibXMLRPCServer for Python 2.5 --- sugar/p2p/network.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sugar/p2p/network.py b/sugar/p2p/network.py index e5b4e4be..90a1e6ee 100644 --- a/sugar/p2p/network.py +++ b/sugar/p2p/network.py @@ -96,9 +96,13 @@ class GlibXMLRPCServer(GlibTCPServer, SimpleXMLRPCServer.SimpleXMLRPCDispatcher) blocking on accept(). """ - def __init__(self, addr, requestHandler=GlibXMLRPCRequestHandler, logRequests=0): + def __init__(self, addr, requestHandler=GlibXMLRPCRequestHandler, + logRequests=0, allow_none=False): self.logRequests = logRequests - SimpleXMLRPCServer.SimpleXMLRPCDispatcher.__init__(self) + if sys.version_info[:3] >= (2, 5, 0): + SimpleXMLRPCServer.SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding="utf-8") + else: + SimpleXMLRPCServer.SimpleXMLRPCDispatcher.__init__(self) GlibTCPServer.__init__(self, addr, requestHandler) def _marshaled_dispatch(self, data, dispatch_method = None):