diff --git a/plextraktsync/cli.py b/plextraktsync/cli.py index 36bc630654..aec5582e17 100644 --- a/plextraktsync/cli.py +++ b/plextraktsync/cli.py @@ -28,6 +28,22 @@ def wrap(*args, **kwargs): cmd(*args, **kwargs) except EOFError as e: raise ClickException(f"Program requested terminal, No terminal is connected: {e}") + except KeyboardInterrupt: + # from plextraktsync.factory import logging + # logger = logging.getLogger(__name__) + # logger.error(e) + # + import asyncio + + try: + loop = asyncio.get_event_loop() + loop.stop() + loop.close() + except RuntimeError: + pass + + # raise ClickException(f"Interrupted! [{e}]") from None + raise ClickException("Interrupted!") except ClickException as e: from plextraktsync.factory import logging