From ea2f71d5274a31228e6a919ec1af3285a4b88781 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Fri, 6 Feb 2004 09:16:40 +0000 Subject: [PATCH] Safety catch to prevent a possible exception at dying time. --- plugins/ChannelStats.py | 5 ++++- plugins/Seen.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/ChannelStats.py b/plugins/ChannelStats.py index e369e764c..7df49aded 100644 --- a/plugins/ChannelStats.py +++ b/plugins/ChannelStats.py @@ -243,7 +243,10 @@ class ChannelStats(callbacks.Privmsg): world.flushers.append(self.db.flush) def die(self): - world.flushers.remove(self.db.flush) + if self.db.flush in world.flushers: + world.flushers.remove(self.db.flush) + else: + self.log.debug('Odd, no flush in flushers: %r', world.flushers) self.db.close() callbacks.Privmsg.die(self) diff --git a/plugins/Seen.py b/plugins/Seen.py index b298b136f..f36a00357 100644 --- a/plugins/Seen.py +++ b/plugins/Seen.py @@ -111,7 +111,10 @@ class Seen(callbacks.Privmsg): callbacks.Privmsg.__init__(self) def die(self): - world.flushers.remove(self.db.flush) + if self.db.flush in world.flushers: + world.flushers.remove(self.db.flush) + else: + self.log.debug('Odd, no flush in flushers: %r', world.flushers) self.db.close() callbacks.Privmsg.die(self)