diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2015-05-21 16:03:21 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2015-05-21 16:03:21 (GMT) |
commit | ff54223606d899c57912dc9f1c5d0d0f331f96b8 (patch) | |
tree | cfd6b25989d484add09076899a69923b22a79ac7 /Lib | |
parent | f3e40fac10fa240b98a709191c6648fdd585b55f (diff) | |
download | cpython-ff54223606d899c57912dc9f1c5d0d0f331f96b8.zip cpython-ff54223606d899c57912dc9f1c5d0d0f331f96b8.tar.gz cpython-ff54223606d899c57912dc9f1c5d0d0f331f96b8.tar.bz2 |
Issue 24017: Use abc.Coroutine in inspect.iscoroutine() function
Diffstat (limited to 'Lib')
-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. |