From: Yury Selivanov Date: Thu, 21 May 2015 16:03:21 +0000 (-0400) Subject: Issue 24017: Use abc.Coroutine in inspect.iscoroutine() function X-Git-Tag: v3.5.0b1~52 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ff54223606d899c57912dc9f1c5d0d0f331f96b8;p=thirdparty%2FPython%2Fcpython.git Issue 24017: Use abc.Coroutine in inspect.iscoroutine() function --- diff --git a/Lib/inspect.py b/Lib/inspect.py index d17a498a37e7..19b57b4b15fe 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -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.