diff --git a/uvloop/includes/stdlib.pxi b/uvloop/includes/stdlib.pxi index 02605a08..5fff4ad8 100644 --- a/uvloop/includes/stdlib.pxi +++ b/uvloop/includes/stdlib.pxi @@ -37,7 +37,6 @@ cdef aio_wait = asyncio.wait cdef aio_wrap_future = asyncio.wrap_future cdef aio_logger = asyncio.log.logger cdef aio_iscoroutine = asyncio.iscoroutine -cdef aio_iscoroutinefunction = asyncio.iscoroutinefunction cdef aio_BaseProtocol = asyncio.BaseProtocol cdef aio_Protocol = asyncio.Protocol cdef aio_isfuture = getattr(asyncio, 'isfuture', None) @@ -65,6 +64,7 @@ cdef gc_disable = gc.disable cdef iter_chain = itertools.chain cdef inspect_isgenerator = inspect.isgenerator +cdef inspect_iscoroutinefunction = inspect.iscoroutinefunction cdef int has_IPV6_V6ONLY = hasattr(socket, 'IPV6_V6ONLY') cdef int IPV6_V6ONLY = getattr(socket, 'IPV6_V6ONLY', -1) diff --git a/uvloop/loop.pyx b/uvloop/loop.pyx index 2ed1f272..28701f22 100644 --- a/uvloop/loop.pyx +++ b/uvloop/loop.pyx @@ -2731,7 +2731,7 @@ cdef class Loop: return transport, protocol def run_in_executor(self, executor, func, *args): - if aio_iscoroutine(func) or aio_iscoroutinefunction(func): + if aio_iscoroutine(func) or inspect_iscoroutinefunction(func): raise TypeError("coroutines cannot be used with run_in_executor()") self._check_closed() @@ -2910,7 +2910,7 @@ cdef class Loop: 'the main thread') if (aio_iscoroutine(callback) - or aio_iscoroutinefunction(callback)): + or inspect_iscoroutinefunction(callback)): raise TypeError( "coroutines cannot be used with add_signal_handler()")