Skip to content

Commit be2966e

Browse files
author
Heyi Tang
committed
Update message
1 parent aea8bd1 commit be2966e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/promptflow-core/promptflow/_utils/async_utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ def on_sigint(self, signum, frame):
4949

5050

5151
async def _invoke_async_with_sigint_handler(async_func, *args, **kwargs):
52-
"""In python>=3.11, the asyncio.run in default cancel the running tasks when sigint is hit.
53-
This is very useful when we call async functions.
54-
So we have a similar implementation here to make sure python>3.11 also have such feature.
52+
"""In python>=3.11, when sigint is hit,
53+
asyncio.run in default cancel the running tasks before raising the KeyboardInterrupt,
54+
this introduces the chance to handle the cancelled error.
55+
So we have a similar implementation here so python<3.11 also have such feature.
5556
https://github.com/python/cpython/blob/46c808172fd3148e3397234b23674bf70734fb55/Lib/asyncio/runners.py#L150
5657
"""
5758
# For the scenario that we don't need to update sigint, just return.

0 commit comments

Comments
 (0)