Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
af928b65
Commit
af928b65
authored
May 13, 2015
by
Yury Selivanov
Browse files
Options
Browse Files
Download
Plain Diff
asyncio: Use 'collections.abc.Coroutine' in asyncio.iscoroutine.
parents
53ffdbd6
c58cca59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
Lib/asyncio/coroutines.py
Lib/asyncio/coroutines.py
+8
-0
No files found.
Lib/asyncio/coroutines.py
View file @
af928b65
...
...
@@ -53,6 +53,11 @@ else:
_is_native_coro_code
=
lambda
code
:
(
code
.
co_flags
&
inspect
.
CO_COROUTINE
)
try
:
from
collections.abc
import
Coroutine
as
CoroutineABC
except
ImportError
:
CoroutineABC
=
None
# Check for CPython issue #21209
def
has_yield_from_bug
():
...
...
@@ -219,6 +224,9 @@ def iscoroutinefunction(func):
_COROUTINE_TYPES
=
(
types
.
GeneratorType
,
CoroWrapper
)
if
CoroutineABC
is
not
None
:
_COROUTINE_TYPES
+=
(
CoroutineABC
,)
def
iscoroutine
(
obj
):
"""Return True if obj is a coroutine object."""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment