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

Commitb35aa85

Browse files
committed
gh-120284: Enableasyncio.runners.Runner to run an awaitable object.
1 parent5d59b87 commitb35aa85

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎Lib/asyncio/runners.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
importfunctools
66
importthreading
77
importsignal
8+
frominspectimportisawaitable
89
from .importcoroutines
910
from .importevents
1011
from .importexceptions
@@ -85,7 +86,7 @@ def get_loop(self):
8586

8687
defrun(self,coro,*,context=None):
8788
"""Run a coroutine inside the embedded event loop."""
88-
ifnotcoroutines.iscoroutine(coro):
89+
ifnotcoroutines.iscoroutine(coro)andnotinspect.isawaitable(coro):
8990
raiseValueError("a coroutine was expected, got {!r}".format(coro))
9091

9192
ifevents._get_running_loop()isnotNone:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp