diff jabberbot/xmlrpcbot.py @ 2128:401d49b9f1ac

Make sure that the ticket and multicall object are deleted.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Fri, 15 Jun 2007 22:13:25 +0200
parents 42232c6ac004
children ea879bd7935d
line wrap: on
line diff
--- a/jabberbot/xmlrpcbot.py	Fri Jun 15 22:03:39 2007 +0200
+++ b/jabberbot/xmlrpcbot.py	Fri Jun 15 22:13:25 2007 +0200
@@ -81,15 +81,16 @@
                 self.multicall.applyAuthToken(self.token)
    
             try:
-                function(self, command)
-                self.commands_out.put_nowait(command)
-            except xmlrpclib.Fault, fault:
-                msg = u"""Your request has failed. The reason is:\n%s"""
-                notification = cmd.NotificationCommand(command.jid, msg % (fault.faultString, ))
-                self.commands_out.put_nowait(notification)
-
-            del self.token
-            del self.multicall
+                try:
+                    function(self, command)
+                    self.commands_out.put_nowait(command)
+                except xmlrpclib.Fault, fault:
+                    msg = u"""Your request has failed. The reason is:\n%s"""
+                    notification = cmd.NotificationCommand(command.jid, msg % (fault.faultString, ))
+                    self.commands_out.put_nowait(notification)
+            finally:
+                del self.token
+                del self.multicall
                 
         return wrapped_func