summaryrefslogtreecommitdiff
path: root/crocoite
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2019-12-29 15:13:47 +0100
committerLars-Dominik Braun <lars@6xq.net>2019-12-29 15:13:47 +0100
commit2bacee3a07c137eae84377b466b302a8c63a61fa (patch)
treeee53327686d995ca63e393818544efed26003ed8 /crocoite
parent66190e68206419879c4dfa919637e185b137cb64 (diff)
downloadcrocoite-2bacee3a07c137eae84377b466b302a8c63a61fa.tar.gz
crocoite-2bacee3a07c137eae84377b466b302a8c63a61fa.tar.bz2
crocoite-2bacee3a07c137eae84377b466b302a8c63a61fa.zip
cli: Ignore future cancellation on the top level
Diffstat (limited to 'crocoite')
-rw-r--r--crocoite/cli.py8
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