mirror of
https://github.com/python/cpython.git
synced 2025-09-30 04:15:43 +00:00
bpo-30098: Clarify that run_coroutine_threadsafe expects asyncio.Future (GH-1170) (#1247)
(cherry picked from commit ae5b3260dd
)
This commit is contained in:
parent
414e0283a3
commit
a3d8dda7d8
1 changed files with 2 additions and 1 deletions
|
@ -517,7 +517,8 @@ def ensure_future(coro_or_future, *, loop=None):
|
||||||
elif compat.PY35 and inspect.isawaitable(coro_or_future):
|
elif compat.PY35 and inspect.isawaitable(coro_or_future):
|
||||||
return ensure_future(_wrap_awaitable(coro_or_future), loop=loop)
|
return ensure_future(_wrap_awaitable(coro_or_future), loop=loop)
|
||||||
else:
|
else:
|
||||||
raise TypeError('A Future, a coroutine or an awaitable is required')
|
raise TypeError('An asyncio.Future, a coroutine or an awaitable is '
|
||||||
|
'required')
|
||||||
|
|
||||||
|
|
||||||
@coroutine
|
@coroutine
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue