mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-18 16:12:42 +01:00
Make sure we don't try to access self.currentServer before it's there. Also,
return the new server from _getNextServer
This commit is contained in:
parent
f39a2849d3
commit
e54ef5d6df
@ -55,7 +55,8 @@ reconnectWaits = [0, 60, 300]
|
|||||||
class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
|
class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
|
||||||
def __init__(self, irc):
|
def __init__(self, irc):
|
||||||
self.irc = irc
|
self.irc = irc
|
||||||
super(SocketDriver, self).__init__(irc)
|
self.__parent = super(SocketDriver, self)
|
||||||
|
self.__parent.__init__(irc)
|
||||||
self.conn = None
|
self.conn = None
|
||||||
self.servers = ()
|
self.servers = ()
|
||||||
self.eagains = 0
|
self.eagains = 0
|
||||||
@ -69,10 +70,11 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
|
|||||||
self.connect()
|
self.connect()
|
||||||
|
|
||||||
def _getNextServer(self):
|
def _getNextServer(self):
|
||||||
oldServer = self.currentServer
|
oldServer = getattr(self, 'currentServer', None)
|
||||||
super(SocketDriver, self)._getNextServer()
|
server = self.__parent._getNextServer()
|
||||||
if self.currentServer != oldServer:
|
if self.currentServer != oldServer:
|
||||||
self.reconnectWaitsIndex = 0
|
self.reconnectWaitsIndex = 0
|
||||||
|
return server
|
||||||
|
|
||||||
def _handleSocketError(self, e):
|
def _handleSocketError(self, e):
|
||||||
# (11, 'Resource temporarily unavailable') raised if connect
|
# (11, 'Resource temporarily unavailable') raised if connect
|
||||||
|
Loading…
Reference in New Issue
Block a user