From fcab1a30cf160401b52045ca92e7ca7a96b2c33e Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 23 Sep 2003 18:45:08 +0000 Subject: [PATCH] Added a try/finally statement like ChannelLogger just got. --- plugins/Relay.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/Relay.py b/plugins/Relay.py index e4ce4a339..e5d20ced3 100644 --- a/plugins/Relay.py +++ b/plugins/Relay.py @@ -135,9 +135,11 @@ class Relay(callbacks.Privmsg): def __call__(self, irc, msg): if not isinstance(irc, irclib.Irc): irc = irc.getRealIrc() - self.ircstates[irc].addMsg(irc, self.lastmsg[irc]) - self.lastmsg[irc] = msg - callbacks.Privmsg.__call__(self, irc, msg) + try: + self.ircstates[irc].addMsg(irc, self.lastmsg[irc]) + callbacks.Privmsg.__call__(self, irc, msg) + finally: + self.lastmsg[irc] = msg def die(self): for irc in self.abbreviations: