aboutsummaryrefslogtreecommitdiffstats
path: root/botcore/utils/scheduling.py
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2022-06-26 21:18:30 +0400
committerGravatar Hassan Abouelela <[email protected]>2022-06-26 21:18:30 +0400
commitecb9a7e4f6b1ddeecbf0e00af4a149a99b4fa4c9 (patch)
tree21b7b9451fc1ae6dcf9371a9b8a237a4a314ecf6 /botcore/utils/scheduling.py
parentChangelog Miscellaneous Bug Fixes (diff)
Document Create Task Return Type
Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'botcore/utils/scheduling.py')
-rw-r--r--botcore/utils/scheduling.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/botcore/utils/scheduling.py b/botcore/utils/scheduling.py
index d9c3937a..8d2f875e 100644
--- a/botcore/utils/scheduling.py
+++ b/botcore/utils/scheduling.py
@@ -208,13 +208,16 @@ class Scheduler:
self._log.error(f"Error in task #{task_id} {id(done_task)}!", exc_info=exception)
+TASK_RETURN = typing.TypeVar("TASK_RETURN")
+
+
def create_task(
- coro: typing.Coroutine,
+ coro: typing.Coroutine[typing.Any, typing.Any, TASK_RETURN],
*,
suppressed_exceptions: tuple[typing.Type[Exception]] = (),
event_loop: typing.Optional[asyncio.AbstractEventLoop] = None,
**kwargs,
-) -> asyncio.Task:
+) -> asyncio.Task[TASK_RETURN]:
"""
Wrapper for creating an :obj:`asyncio.Task` which logs exceptions raised in the task.