Remove event loop policy check

pull/23783/head
Lidi Zheng 4 years ago
parent f959c12828
commit 4ed38373ae
  1. 13
      src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pyx.pxi

@ -24,19 +24,6 @@ cdef bint _has_fd_monitoring = True
IF UNAME_SYSNAME == "Windows":
cdef void _unified_socket_write(int fd) nogil:
win_socket_send(<WIN_SOCKET>fd, b"1", 1, 0)
# If the event loop policy is Proactor, then immediately turn on fall back
# mode.
try:
if hasattr(asyncio, 'WindowsProactorEventLoopPolicy') and \
isinstance(asyncio.get_event_loop_policy(), asyncio.WindowsProactorEventLoopPolicy):
_has_fd_monitoring = False
elif isinstance(asyncio.get_event_loop_policy(), asyncio.DefaultEventLoopPolicy):
if sys.version_info >= (3, 8, 0):
_has_fd_monitoring = False
except NameError:
# Pass if asyncio is not imported for 2.7
pass
ELSE:
from posix cimport unistd

Loading…
Cancel
Save