diff options
-rw-r--r-- | Lib/inspect.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py index d17a498..19b57b4 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. |