We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d08c363 commit c58cca5Copy full SHA for c58cca5
Lib/asyncio/coroutines.py
@@ -53,6 +53,11 @@
53
_is_native_coro_code = lambda code: (code.co_flags &
54
inspect.CO_COROUTINE)
55
56
+try:
57
+ from collections.abc import Coroutine as CoroutineABC
58
+except ImportError:
59
+ CoroutineABC = None
60
+
61
62
# Check for CPython issue #21209
63
def has_yield_from_bug():
@@ -219,6 +224,9 @@ def iscoroutinefunction(func):
219
224
220
225
221
226
_COROUTINE_TYPES = (types.GeneratorType, CoroWrapper)
227
+if CoroutineABC is not None:
228
+ _COROUTINE_TYPES += (CoroutineABC,)
229
222
230
223
231
def iscoroutine(obj):
232
"""Return True if obj is a coroutine object."""
0 commit comments