From f63fa6846f0b1f4ce78994e034dee9459e556d81 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Mon, 10 Jan 2005 20:41:23 +0000 Subject: [PATCH] Elucidating comment, XXX, and hopefully a fix for the problems with using Network.disconnect while a socketDriver is reconnecting. --- src/irclib.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/irclib.py b/src/irclib.py index 3c31d37e7..bafe8fb77 100644 --- a/src/irclib.py +++ b/src/irclib.py @@ -920,7 +920,7 @@ class Irc(IrcCommandDispatcher): if not self.zombie: if msg.args[0].startswith('Closing Link'): self.driver.reconnect() - elif 'too fast' in msg.args[0]: + elif 'too fast' in msg.args[0]: # Connecting too fast. self.driver.reconnect(wait=True) def doNick(self, msg): @@ -951,6 +951,11 @@ class Irc(IrcCommandDispatcher): def _reallyDie(self): """Makes the Irc object die. Dead.""" log.info('Irc object for %s dying.' % self.network) + # XXX This hasattr should be removed, I'm just putting it here because + # we're so close to a release. After 0.80.0 we should remove this + # and fix whatever AttributeErrors arise in the drivers themselves. + if self.driver is not None and hasattr(self.driver, 'die'): + self.driver.die() if self in world.ircs: world.ircs.remove(self) # Only kill the callbacks if we're the last Irc.