From: Andrew M. Kuchling Date: Tue, 5 Sep 2006 13:15:41 +0000 (+0000) Subject: [Bug #1525469] SimpleXMLRPCServer still uses the sys.exc_{value,type} module-level... X-Git-Tag: v2.6a1~2699 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a5453c48d56317c9abfd141461fd16f01274f45d;p=thirdparty%2FPython%2Fcpython.git [Bug #1525469] SimpleXMLRPCServer still uses the sys.exc_{value,type} module-level globals instead of calling sys.exc_info(). Reported by Russell Warren --- diff --git a/Lib/SimpleXMLRPCServer.py b/Lib/SimpleXMLRPCServer.py index 7a9f26faaaba..53ad9c5d2201 100644 --- a/Lib/SimpleXMLRPCServer.py +++ b/Lib/SimpleXMLRPCServer.py @@ -264,8 +264,9 @@ class SimpleXMLRPCDispatcher: encoding=self.encoding) except: # report exception back to server + exc_type, exc_value, exc_tb = sys.exc_info() response = xmlrpclib.dumps( - xmlrpclib.Fault(1, "%s:%s" % (sys.exc_type, sys.exc_value)), + xmlrpclib.Fault(1, "%s:%s" % (exc_type, exc_value)), encoding=self.encoding, allow_none=self.allow_none, ) @@ -364,9 +365,10 @@ class SimpleXMLRPCDispatcher: 'faultString' : fault.faultString} ) except: + exc_type, exc_value, exc_tb = sys.exc_info() results.append( {'faultCode' : 1, - 'faultString' : "%s:%s" % (sys.exc_type, sys.exc_value)} + 'faultString' : "%s:%s" % (exc_type, exc_value)} ) return results