From e54ef5d6df25bfc59ec008109cefb089f0b66a1a Mon Sep 17 00:00:00 2001 From: James Vega Date: Tue, 11 Jan 2005 13:52:56 +0000 Subject: [PATCH] Make sure we don't try to access self.currentServer before it's there. Also, return the new server from _getNextServer --- src/socketDrivers.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/socketDrivers.py b/src/socketDrivers.py index fae22abfb..de5438c8a 100644 --- a/src/socketDrivers.py +++ b/src/socketDrivers.py @@ -55,7 +55,8 @@ reconnectWaits = [0, 60, 300] class SocketDriver(drivers.IrcDriver, drivers.ServersMixin): def __init__(self, irc): self.irc = irc - super(SocketDriver, self).__init__(irc) + self.__parent = super(SocketDriver, self) + self.__parent.__init__(irc) self.conn = None self.servers = () self.eagains = 0 @@ -69,11 +70,12 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin): self.connect() def _getNextServer(self): - oldServer = self.currentServer - super(SocketDriver, self)._getNextServer() + oldServer = getattr(self, 'currentServer', None) + server = self.__parent._getNextServer() if self.currentServer != oldServer: self.reconnectWaitsIndex = 0 - + return server + def _handleSocketError(self, e): # (11, 'Resource temporarily unavailable') raised if connect # hasn't finished yet. We'll keep track of how many we get.