Issue 24017: Use abc.Coroutine in inspect.iscoroutine() function

This commit is contained in:
Yury Selivanov 2015-05-21 12:03:21 -04:00
parent f3e40fac10
commit ff54223606
1 changed files with 1 additions and 2 deletions

View File

@ -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.