Skip to content

Commit 7a9092a

Browse files
authored
FastStream: Fix dirty output on Ctrl+C (#134)
1 parent f59c073 commit 7a9092a

File tree

1 file changed

+4
-1
lines changed
  • packages/faststream-stomp/faststream_stomp

1 file changed

+4
-1
lines changed

packages/faststream-stomp/faststream_stomp/broker.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ def get_schema(self) -> dict[str, dict[str, str]]: # noqa: PLR6301
3333

3434
def _handle_listen_task_done(listen_task: asyncio.Task[None]) -> None:
3535
# Not sure how to test this. See https://github.com/community-of-python/stompman/pull/117#issuecomment-2983584449.
36-
task_exception = listen_task.exception()
36+
try:
37+
task_exception = listen_task.exception()
38+
except asyncio.CancelledError:
39+
return
3740
if isinstance(task_exception, ExceptionGroup) and isinstance(
3841
task_exception.exceptions[0], stompman.FailedAllConnectAttemptsError
3942
):

0 commit comments

Comments
 (0)