aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Numerlor <[email protected]>2022-07-26 17:58:23 +0200
committerGravatar GitHub <[email protected]>2022-07-26 15:58:23 +0000
commit20ed26e794c677205417a475b5d3719822e4bc4b (patch)
tree5c65aa5a9f2797a45a1ba57804699e878e9a1e53
parentBump sphinx from 5.0.2 to 5.1.0 (#109) (diff)
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
-rw-r--r--botcore/utils/scheduling.py4
1 files changed, 2 insertions, 2 deletions
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()