Double Ctrl-C or other situation could cause ugly traceback, avoid that situation by exiting quietly on CancelledError and KeyboardInterrupt.
This commit is contained in:
@@ -371,7 +371,10 @@ def main():
|
||||
if not args.url.startswith(("ws://", "wss://")):
|
||||
p.error("url must start with ws:// or wss://")
|
||||
|
||||
try:
|
||||
asyncio.run(serve(args.url, SeedX()))
|
||||
except (KeyboardInterrupt, asyncio.CancelledError):
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user