From b1f98f86ff058cbf9f678312dc831feaf671632a Mon Sep 17 00:00:00 2001 From: Yuta Hayashibe Date: Sat, 1 Oct 2022 23:43:50 +0900 Subject: [PATCH] Catch KeyboardInterrupt --- whispering/cli.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/whispering/cli.py b/whispering/cli.py index af93f98..8b60271 100644 --- a/whispering/cli.py +++ b/whispering/cli.py @@ -214,11 +214,14 @@ def main() -> None: if opts.mode == "client": assert opts.language is None assert opts.model is None - asyncio.run( - run_websocket_client( - opts=opts, + try: + asyncio.run( + run_websocket_client( + opts=opts, + ) ) - ) + except KeyboardInterrupt: + pass else: assert opts.language is not None assert opts.model is not None