From d31a9eacb6add5c7bfa8ed221c3796cbb080fad2 Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Wed, 24 Apr 2013 16:44:41 +0100 Subject: [PATCH] eventio: Fixes select bad file descriptor handling --- kombu/utils/eventio.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kombu/utils/eventio.py b/kombu/utils/eventio.py index 8325ae7b..80b1501f 100644 --- a/kombu/utils/eventio.py +++ b/kombu/utils/eventio.py @@ -198,7 +198,7 @@ class _select(Poller): for fd in self._rfd | self._wfd | self._efd: try: _selectf([fd], [], [], 0) - except _selecterr, exc: + except (_selecterr, socket.error), exc: if get_errno(exc) in SELECT_BAD_FD: self.unregister(fd) @@ -212,11 +212,12 @@ class _select(Poller): read, write, error = _selectf( self._rfd, self._wfd, self._efd, timeout, ) - except _selecterr, exc: + except (_selecterr, socket.error), exc: if get_errno(exc) == errno.EINTR: return elif get_errno(exc) in SELECT_BAD_FD: - self._remove_bad() + return self._remove_bad() + raise events = {} for fd in read: