From 890f080dbc9bf5d22469cce168437f03b8eaad63 Mon Sep 17 00:00:00 2001 From: alemidev Date: Fri, 17 Dec 2021 16:39:27 +0100 Subject: [PATCH] use global, kinda ugly but ehhh... --- aiocraft/traits/runnable.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aiocraft/traits/runnable.py b/aiocraft/traits/runnable.py index 55b275a..c07bb7c 100644 --- a/aiocraft/traits/runnable.py +++ b/aiocraft/traits/runnable.py @@ -17,12 +17,17 @@ class Runnable: await self.stop(force=True) def run(self): + global DONE + global FORCE_QUIT + logging.info("Starting process") DONE = asyncio.Event() FORCE_QUIT = asyncio.Event() def signal_handler(signum, __): + global DONE + global FORCE_QUIT if signum == SIGINT: if DONE.is_set(): logging.info("Received SIGINT, terminating")