aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorW. Trevor King <wking@tremily.us>2012-09-28 02:39:02 -0400
committerW. Trevor King <wking@tremily.us>2012-09-29 07:03:51 -0400
commit6e44dc1ff5905ac59fe6428c5ea17cd3d179407b (patch)
tree09ac5e0fcaa4ffce45568cba14f33cb596e6b6a6 /plugins
parente00a8f0217a79d25b655223c17cc2d4752c816a4 (diff)
downloadikiwiki-6e44dc1ff5905ac59fe6428c5ea17cd3d179407b.tar
ikiwiki-6e44dc1ff5905ac59fe6428c5ea17cd3d179407b.tar.gz
proxy: SimpleXMLRPCServer renamed to xmlrpc.server in Python 3
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/proxy.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/proxy.py b/plugins/proxy.py
index 51364cb31..60ea89967 100755
--- a/plugins/proxy.py
+++ b/plugins/proxy.py
@@ -43,7 +43,10 @@ try: # Python 3
import xmlrpc.client as _xmlrpc_client
except ImportError: # Python 2
import xmlrpclib as _xmlrpc_client
-from SimpleXMLRPCServer import SimpleXMLRPCDispatcher
+try: # Python 3
+ import xmlrpc.server as _xmlrpc_server
+except ImportError: # Python 2
+ import SimpleXMLRPCServer as _xmlrpc_server
class ParseError (Exception):
@@ -66,15 +69,16 @@ class AlreadyImported (Exception):
pass
-class _IkiWikiExtPluginXMLRPCDispatcher(SimpleXMLRPCDispatcher):
+class _IkiWikiExtPluginXMLRPCDispatcher(_xmlrpc_server.SimpleXMLRPCDispatcher):
def __init__(self, allow_none=False, encoding=None):
try:
- SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding)
+ _xmlrpc_server.SimpleXMLRPCDispatcher.__init__(
+ self, allow_none, encoding)
except TypeError:
# see http://bugs.debian.org/470645
# python2.4 and before only took one argument
- SimpleXMLRPCDispatcher.__init__(self)
+ _xmlrpc_server.SimpleXMLRPCDispatcher.__init__(self)
def dispatch(self, method, params):
return self._dispatch(method, params)