diff options
Diffstat (limited to 'crocoite')
-rw-r--r-- | crocoite/cli.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crocoite/cli.py b/crocoite/cli.py index 53a0b32..04bbb19 100644 --- a/crocoite/cli.py +++ b/crocoite/cli.py @@ -202,8 +202,12 @@ def recursive (): stop = lambda signum: run.cancel () loop.add_signal_handler (signal.SIGINT, stop, signal.SIGINT) loop.add_signal_handler (signal.SIGTERM, stop, signal.SIGTERM) - loop.run_until_complete(run) - loop.close() + try: + loop.run_until_complete(run) + except asyncio.CancelledError: + pass + finally: + loop.close() return 0 |