Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita6492e9

Browse files
add wrapper
1 parent2999e02 commita6492e9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎Lib/asyncio/tasks.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from .importexceptions
2626
from .importfutures
2727
from .importtimeouts
28-
from .coroutinesimport_is_coroutine
2928

3029
# Helper to generate new task names
3130
# This uses itertools.count() instead of a "+= 1" operation because the latter
@@ -654,17 +653,18 @@ def ensure_future(coro_or_future, *, loop=None):
654653
raise
655654

656655

657-
@types.coroutine
658-
def_wrap_awaitable(awaitable):
656+
asyncdef_wrap_awaitable(awaitable):
659657
"""Helper for asyncio.ensure_future().
660658
661659
Wraps awaitable (an object with __await__) into a coroutine
662660
that will later be wrapped in a Task by ensure_future().
663661
"""
664-
return (yieldfromawaitable.__await__())
665662

666-
_wrap_awaitable._is_coroutine=_is_coroutine
663+
@types.coroutine
664+
defwrapper(awaitable):
665+
return (yieldfromawaitable.__await__())
667666

667+
returnawaitwrapper(awaitable)
668668

669669
class_GatheringFuture(futures.Future):
670670
"""Helper for gather().

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp