mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Issue 24017: Use abc.Coroutine in inspect.iscoroutine() function
This commit is contained in:
parent
f3e40fac10
commit
ff54223606
1 changed files with 1 additions and 2 deletions
|
|
@ -212,8 +212,7 @@ def isgenerator(object):
|
|||
|
||||
def iscoroutine(object):
|
||||
"""Return true if the object is a coroutine."""
|
||||
return (isinstance(object, types.GeneratorType) and
|
||||
object.gi_code.co_flags & (CO_COROUTINE | CO_ITERABLE_COROUTINE))
|
||||
return isinstance(object, collections.abc.Coroutine)
|
||||
|
||||
def istraceback(object):
|
||||
"""Return true if the object is a traceback.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue