From: Pierce Lopez Date: Mon, 31 May 2021 21:55:06 +0000 (-0400) Subject: ioloop: add_timeout() and call_at() take any Callable X-Git-Tag: v6.2.0b1~21^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3035%2Fhead;p=thirdparty%2Ftornado.git ioloop: add_timeout() and call_at() take any Callable clean-up some methods that were missed in https://github.com/tornadoweb/tornado/pull/2924 --- diff --git a/tornado/ioloop.py b/tornado/ioloop.py index 28d86f504..6fa7d87d5 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -547,7 +547,7 @@ class IOLoop(Configurable): def add_timeout( self, deadline: Union[float, datetime.timedelta], - callback: Callable[..., Optional[Awaitable]], + callback: Callable, *args: Any, **kwargs: Any ) -> object: diff --git a/tornado/platform/asyncio.py b/tornado/platform/asyncio.py index 5e9c776d0..31c949aed 100644 --- a/tornado/platform/asyncio.py +++ b/tornado/platform/asyncio.py @@ -204,11 +204,7 @@ class BaseAsyncIOLoop(IOLoop): self.asyncio_loop.stop() def call_at( - self, - when: float, - callback: Callable[..., Optional[Awaitable]], - *args: Any, - **kwargs: Any + self, when: float, callback: Callable, *args: Any, **kwargs: Any ) -> object: # asyncio.call_at supports *args but not **kwargs, so bind them here. # We do not synchronize self.time and asyncio_loop.time, so