From 20ed26e794c677205417a475b5d3719822e4bc4b Mon Sep 17 00:00:00 2001 From: Numerlor <25886452+Numerlor@users.noreply.github.com> Date: Tue, 26 Jul 2022 17:58:23 +0200 Subject: Fix suppressed_exceptions type hint (#112) The previous type hint expected a tuple with a single exception type instead of a variable length tuple of exception types --- botcore/utils/scheduling.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'botcore/utils/scheduling.py') diff --git a/botcore/utils/scheduling.py b/botcore/utils/scheduling.py index ebc42665..9517df6d 100644 --- a/botcore/utils/scheduling.py +++ b/botcore/utils/scheduling.py @@ -215,7 +215,7 @@ TASK_RETURN = typing.TypeVar("TASK_RETURN") def create_task( coro: abc.Coroutine[typing.Any, typing.Any, TASK_RETURN], *, - suppressed_exceptions: tuple[type[Exception]] = (), + suppressed_exceptions: tuple[type[Exception], ...] = (), event_loop: typing.Optional[asyncio.AbstractEventLoop] = None, **kwargs, ) -> asyncio.Task[TASK_RETURN]: @@ -242,7 +242,7 @@ def create_task( return task -def _log_task_exception(task: asyncio.Task, *, suppressed_exceptions: tuple[type[Exception]]) -> None: +def _log_task_exception(task: asyncio.Task, *, suppressed_exceptions: tuple[type[Exception], ...]) -> None: """Retrieve and log the exception raised in ``task`` if one exists.""" with contextlib.suppress(asyncio.CancelledError): exception = task.exception() -- cgit v1.2.3