Specifically handle OSError (e.g. Network is unreachable) as a disconnect

This commit is contained in:
jesopo 2018-10-26 11:30:16 +01:00
parent c5e1fafeb1
commit 3094bb7748

View file

@ -221,7 +221,7 @@ class Server(IRCObject.Object):
data = b""
try:
data = self.socket.recv(4096)
except (ConnectionResetError, socket.timeout):
except (ConnectionResetError, socket.timeout, OSError):
self.disconnect()
return None
if not data: