提交 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): ...@@ -711,7 +711,7 @@ class IOLoop(Configurable):
executor: Optional[concurrent.futures.Executor], executor: Optional[concurrent.futures.Executor],
func: Callable[..., _T], func: Callable[..., _T],
*args: Any *args: Any
) -> Awaitable[_T]: ) -> "Future[_T]":
"""Runs a function in a ``concurrent.futures.Executor``. If """Runs a function in a ``concurrent.futures.Executor``. If
``executor`` is ``None``, the IO loop's default executor will be used. ``executor`` is ``None``, the IO loop's default executor will be used.
......
...@@ -37,7 +37,6 @@ from tornado.ioloop import IOLoop, _Selectable ...@@ -37,7 +37,6 @@ from tornado.ioloop import IOLoop, _Selectable
from typing import ( from typing import (
Any, Any,
Awaitable,
Callable, Callable,
Dict, Dict,
List, List,
...@@ -237,7 +236,7 @@ class BaseAsyncIOLoop(IOLoop): ...@@ -237,7 +236,7 @@ class BaseAsyncIOLoop(IOLoop):
executor: Optional[concurrent.futures.Executor], executor: Optional[concurrent.futures.Executor],
func: Callable[..., _T], func: Callable[..., _T],
*args: Any, *args: Any,
) -> Awaitable[_T]: ) -> "asyncio.Future[_T]":
return self.asyncio_loop.run_in_executor(executor, func, *args) return self.asyncio_loop.run_in_executor(executor, func, *args)
def set_default_executor(self, executor: concurrent.futures.Executor) -> None: 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.
先完成此消息的编辑!
想要评论请 注册