bpo-30098: Clarify that run_coroutine_threadsafe expects asyncio.Future (GH-1170) (#1247)

(cherry picked from commit ae5b3260dd)
This commit is contained in:
Mariatta 2017-04-21 19:58:28 -07:00 committed by GitHub
parent 414e0283a3
commit a3d8dda7d8

View file

@ -517,7 +517,8 @@ def ensure_future(coro_or_future, *, loop=None):
elif compat.PY35 and inspect.isawaitable(coro_or_future):
return ensure_future(_wrap_awaitable(coro_or_future), loop=loop)
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