From 1f5e52505fac448b605b86342a9cda53feefb297 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Sun, 20 Sep 2026 01:14:47 +0000 Subject: [PATCH] Double Ctrl-C or other situation could cause ugly traceback, avoid that situation by exiting quietly on CancelledError and KeyboardInterrupt. --- scripts/translator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/translator.py b/scripts/translator.py index 04a119c..de1c2fb 100644 --- a/scripts/translator.py +++ b/scripts/translator.py @@ -371,7 +371,10 @@ def main(): if not args.url.startswith(("ws://", "wss://")): p.error("url must start with ws:// or wss://") - asyncio.run(serve(args.url, SeedX())) + try: + asyncio.run(serve(args.url, SeedX())) + except (KeyboardInterrupt, asyncio.CancelledError): + pass if __name__ == "__main__":