Check against correct types

This commit is contained in:
Fabrice Rabaute 2013-11-18 18:01:00 -08:00 committed by Ask Solem
parent 7c4d27fc33
commit 74e78e1da4
1 changed files with 5 additions and 3 deletions

View File

@ -11,6 +11,8 @@ import errno
import select as __select__
import socket
from kombu.five import int_types
_selectf = __select__.select
_selecterr = __select__.error
epoll = getattr(__select__, 'epoll', None)
@ -219,15 +221,15 @@ class _select(Poller):
events = {}
for fd in read:
if not isinstance(fd, int):
if not isinstance(fd, int_types):
fd = fd.fileno()
events[fd] = events.get(fd, 0) | READ
for fd in write:
if not isinstance(fd, int):
if not isinstance(fd, int_types):
fd = fd.fileno()
events[fd] = events.get(fd, 0) | WRITE
for fd in error:
if not isinstance(fd, int):
if not isinstance(fd, int_types):
fd = fd.fileno()
events[fd] = events.get(fd, 0) | ERR
return list(events.items())