Added a try/finally statement like ChannelLogger just got.

This commit is contained in:
Jeremy Fincher 2003-09-23 18:45:08 +00:00
parent 3f78522f15
commit fcab1a30cf

View File

@ -135,9 +135,11 @@ class Relay(callbacks.Privmsg):
def __call__(self, irc, msg): def __call__(self, irc, msg):
if not isinstance(irc, irclib.Irc): if not isinstance(irc, irclib.Irc):
irc = irc.getRealIrc() irc = irc.getRealIrc()
self.ircstates[irc].addMsg(irc, self.lastmsg[irc]) try:
self.lastmsg[irc] = msg self.ircstates[irc].addMsg(irc, self.lastmsg[irc])
callbacks.Privmsg.__call__(self, irc, msg) callbacks.Privmsg.__call__(self, irc, msg)
finally:
self.lastmsg[irc] = msg
def die(self): def die(self):
for irc in self.abbreviations: for irc in self.abbreviations: