提交 7075748e 编写于 作者: B Ben Darnell

ioloop: Annotate run_in_executor returning Future, not Awaitable

This required a recent update to typeshed/mypy.

Fixes #3093
上级 8bfa66ac
......@@ -711,7 +711,7 @@ class IOLoop(Configurable):
executor: Optional[concurrent.futures.Executor],
func: Callable[..., _T],
*args: Any
) -> Awaitable[_T]:
) -> "Future[_T]":
"""Runs a function in a ``concurrent.futures.Executor``. If
``executor`` is ``None``, the IO loop's default executor will be used.
......
......@@ -37,7 +37,6 @@ from tornado.ioloop import IOLoop, _Selectable
from typing import (
Any,
Awaitable,
Callable,
Dict,
List,
......@@ -237,7 +236,7 @@ class BaseAsyncIOLoop(IOLoop):
executor: Optional[concurrent.futures.Executor],
func: Callable[..., _T],
*args: Any,
) -> Awaitable[_T]:
) -> "asyncio.Future[_T]":
return self.asyncio_loop.run_in_executor(executor, func, *args)
def set_default_executor(self, executor: concurrent.futures.Executor) -> None:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册