From 20e5bdb50dc2651c695fddd936c5835b3c78c278 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 23 Sep 2003 16:01:04 +0000 Subject: [PATCH] Added a try/finally statement to the addMsg in __call__ so lastMsg will still get updated if it raises an exception. --- plugins/ChannelLogger.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/ChannelLogger.py b/plugins/ChannelLogger.py index c451537f6..672e58c8a 100644 --- a/plugins/ChannelLogger.py +++ b/plugins/ChannelLogger.py @@ -61,11 +61,13 @@ class ChannelLogger(irclib.IrcCallback): world.flushers.remove(self.flush) def __call__(self, irc, msg): - super(self.__class__, self).__call__(irc, msg) - #self.__class__.__bases__[0].__call__(self, irc, msg) - if self.lastMsg: - self.laststate.addMsg(irc, self.lastMsg) - self.lastMsg = msg + try: + super(self.__class__, self).__call__(irc, msg) + if self.lastMsg: + self.laststate.addMsg(irc, self.lastMsg) + finally: + # We must make this always gets updated. + self.lastMsg = msg def reset(self): for log in self.logs.itervalues():