Skip to content

Commit 74e8760

Browse files
do not use deprecated asyncio.iscoroutinefunction prefer inspect.iscoroutinefunction
1 parent 74f4c96 commit 74e8760

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

uvloop/includes/stdlib.pxi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ cdef aio_wait = asyncio.wait
3737
cdef aio_wrap_future = asyncio.wrap_future
3838
cdef aio_logger = asyncio.log.logger
3939
cdef aio_iscoroutine = asyncio.iscoroutine
40-
cdef aio_iscoroutinefunction = asyncio.iscoroutinefunction
4140
cdef aio_BaseProtocol = asyncio.BaseProtocol
4241
cdef aio_Protocol = asyncio.Protocol
4342
cdef aio_isfuture = getattr(asyncio, 'isfuture', None)
@@ -65,6 +64,7 @@ cdef gc_disable = gc.disable
6564

6665
cdef iter_chain = itertools.chain
6766
cdef inspect_isgenerator = inspect.isgenerator
67+
cdef inspect_iscoroutinefunction = inspect.iscoroutinefunction
6868

6969
cdef int has_IPV6_V6ONLY = hasattr(socket, 'IPV6_V6ONLY')
7070
cdef int IPV6_V6ONLY = getattr(socket, 'IPV6_V6ONLY', -1)

uvloop/loop.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2731,7 +2731,7 @@ cdef class Loop:
27312731
return transport, protocol
27322732

27332733
def run_in_executor(self, executor, func, *args):
2734-
if aio_iscoroutine(func) or aio_iscoroutinefunction(func):
2734+
if aio_iscoroutine(func) or inspect_iscoroutinefunction(func):
27352735
raise TypeError("coroutines cannot be used with run_in_executor()")
27362736

27372737
self._check_closed()
@@ -2910,7 +2910,7 @@ cdef class Loop:
29102910
'the main thread')
29112911

29122912
if (aio_iscoroutine(callback)
2913-
or aio_iscoroutinefunction(callback)):
2913+
or inspect_iscoroutinefunction(callback)):
29142914
raise TypeError(
29152915
"coroutines cannot be used with add_signal_handler()")
29162916

0 commit comments

Comments
 (0)