diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pxd.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pxd.pxi index 578131f7eef..ed9cab2b2b0 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pxd.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pxd.pxi @@ -23,7 +23,7 @@ IF UNAME_SYSNAME == "Windows": int win_socket_send "send" (WIN_SOCKET s, const char *buf, int len, int flags) -cdef void _unified_socket_write(int fd) nogil +cdef void _unified_socket_write(int fd) noexcept nogil cdef class BaseCompletionQueue: @@ -48,5 +48,5 @@ cdef class PollerCompletionQueue(BaseCompletionQueue): cdef object _write_socket # socket.socket cdef dict _loops # Mapping[asyncio.AbstractLoop, _BoundEventLoop] - cdef void _poll(self) nogil + cdef void _poll(self) noexcept nogil cdef shutdown(self) diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pyx.pxi index eb33e41aebb..288da3c6f7e 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pyx.pxi @@ -22,12 +22,12 @@ cdef float _POLL_AWAKE_INTERVAL_S = 0.2 cdef bint _has_fd_monitoring = True IF UNAME_SYSNAME == "Windows": - cdef void _unified_socket_write(int fd) nogil: + cdef void _unified_socket_write(int fd) noexcept nogil: win_socket_send(fd, b"1", 1, 0) ELSE: from posix cimport unistd - cdef void _unified_socket_write(int fd) nogil: + cdef void _unified_socket_write(int fd) noexcept nogil: unistd.write(fd, b"1", 1) @@ -94,7 +94,7 @@ cdef class PollerCompletionQueue(BaseCompletionQueue): else: self._loops[loop] = _BoundEventLoop(loop, self._read_socket, self._handle_events) - cdef void _poll(self) nogil: + cdef void _poll(self) noexcept nogil: cdef grpc_event event cdef CallbackContext *context