3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

selectdriver: don't try to deregister dead sockets

This commit is contained in:
James Lu 2018-03-17 15:33:39 -07:00
parent ab70d7c8fb
commit fb6c3bf6d5

View File

@ -33,8 +33,11 @@ def unregister(irc):
"""
Removes a network from the global selectors instance.
"""
log.debug('selectdriver: de-registering %s for network %s', irc._socket, irc.name)
selector.unregister(irc._socket)
if irc._socket.fileno() != -1:
log.debug('selectdriver: de-registering %s for network %s', irc._socket, irc.name)
selector.unregister(irc._socket)
else:
log.debug('selectdriver: skipping de-registering %s for network %s', irc._socket, irc.name)
def start():
"""