|
|
@ -77,6 +77,7 @@ def _fileobj_to_fd(fileobj):
|
|
|
|
raise ValueError("Invalid file descriptor: {0}".format(fd))
|
|
|
|
raise ValueError("Invalid file descriptor: {0}".format(fd))
|
|
|
|
return fd
|
|
|
|
return fd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Python 3.5 uses a more direct route to wrap system calls to increase speed.
|
|
|
|
# Python 3.5 uses a more direct route to wrap system calls to increase speed.
|
|
|
|
if sys.version_info >= (3, 5):
|
|
|
|
if sys.version_info >= (3, 5):
|
|
|
|
def _syscall_wrapper(func, _, *args, **kwargs):
|
|
|
|
def _syscall_wrapper(func, _, *args, **kwargs):
|
|
|
@ -305,6 +306,7 @@ class BaseSelector(object):
|
|
|
|
def __exit__(self, *args):
|
|
|
|
def __exit__(self, *args):
|
|
|
|
self.close()
|
|
|
|
self.close()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Almost all platforms have select.select()
|
|
|
|
# Almost all platforms have select.select()
|
|
|
|
if hasattr(select, "select"):
|
|
|
|
if hasattr(select, "select"):
|
|
|
|
class SelectSelector(BaseSelector):
|
|
|
|
class SelectSelector(BaseSelector):
|
|
|
|