Socket: Recover from socks.GeneralProxyError exceptions.

This commit is contained in:
Valentin Lorentz 2021-04-05 13:41:29 +02:00
parent 16fc2aef93
commit 9323302704
1 changed files with 3 additions and 1 deletions

View File

@ -323,7 +323,9 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
self.connected = True
self.resetDelay()
except socket.error as e:
if e.args[0] == 115:
if len(e.args) >= 1 and e.args[0] == 115:
# e.args may be () in some circumstances,
# eg. when e is an instance of socks.GeneralProxyError
now = time.time()
when = now + 60
whenS = log.timestamp(when)