From e55c0412b24a7ecb5026ba2878eab904852f889c Mon Sep 17 00:00:00 2001 From: "Bruno P. Kinoshita" Date: Wed, 15 Jul 2020 11:35:51 +1200 Subject: [PATCH] Catch CancelledError in scheduler_cli run function --- cylc/flow/scheduler_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cylc/flow/scheduler_cli.py b/cylc/flow/scheduler_cli.py index f9042fb01c7..cbf2c973356 100644 --- a/cylc/flow/scheduler_cli.py +++ b/cylc/flow/scheduler_cli.py @@ -417,7 +417,7 @@ async def _run(parser, options, reg, is_restart, scheduler): # stop cylc stop except SchedulerError: ret = 1 - except KeyboardInterrupt as exc: + except (KeyboardInterrupt, asyncio.exceptions.CancelledError) as exc: try: await scheduler.shutdown(exc) except Exception as exc2: