diff options
| author | Lars-Dominik Braun <lars@6xq.net> | 2019-12-29 15:13:47 +0100 | 
|---|---|---|
| committer | Lars-Dominik Braun <lars@6xq.net> | 2019-12-29 15:13:47 +0100 | 
| commit | 2bacee3a07c137eae84377b466b302a8c63a61fa (patch) | |
| tree | ee53327686d995ca63e393818544efed26003ed8 | |
| parent | 66190e68206419879c4dfa919637e185b137cb64 (diff) | |
| download | crocoite-2bacee3a07c137eae84377b466b302a8c63a61fa.tar.gz crocoite-2bacee3a07c137eae84377b466b302a8c63a61fa.tar.bz2 crocoite-2bacee3a07c137eae84377b466b302a8c63a61fa.zip | |
cli: Ignore future cancellation on the top level
| -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 | 
