changeset 1160:3c80692b9b47

Added support for XMLRPC functions that return a Fault instance.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Wed, 09 Aug 2006 16:59:34 +0200
parents 0432e8a9ba2f
children 84ca2d77b8e4
files MoinMoin/xmlrpc/__init__.py
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/xmlrpc/__init__.py	Tue Aug 08 22:05:59 2006 +0200
+++ b/MoinMoin/xmlrpc/__init__.py	Wed Aug 09 16:59:34 2006 +0200
@@ -125,11 +125,14 @@
             # report exception back to server
             response = xmlrpclib.dumps(xmlrpclib.Fault(1, self._dump_exc()))
         else:
-            # wrap response in a singleton tuple
-            response = (response,)
-
-            # serialize it
-            response = xmlrpclib.dumps(response, methodresponse=1)
+            if isinstance(response, xmlrpclib.Fault):
+                response = xmlrpclib.dumps(response)
+            else:
+                # wrap response in a singleton tuple
+                response = (response,)
+    
+                # serialize it
+                response = xmlrpclib.dumps(response, methodresponse=1)
 
         self.request.emit_http_headers([
             "Content-Type: text/xml; charset=utf-8",