This commit is contained in:
Ask Solem 2014-04-10 15:21:27 +01:00
parent 84d482aba9
commit 64acac68f9
1 changed files with 8 additions and 1 deletions

View File

@ -202,7 +202,14 @@ class _select(Poller):
self.unregister(fd) self.unregister(fd)
def unregister(self, fd): def unregister(self, fd):
fd = fileno(fd) try:
fd = fileno(fd)
except socket.error as exc:
# we don't know the previous fd of this object
# but it will be removed by the next poll iteration.
if get_errno(exc) in SELECT_BAD_FD:
return
raise
self._rfd.discard(fd) self._rfd.discard(fd)
self._wfd.discard(fd) self._wfd.discard(fd)
self._efd.discard(fd) self._efd.discard(fd)