From ef5824892b379af56ce5248264436ab56c1ed7a1 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 24 Feb 2022 22:27:27 +0000 Subject: [PATCH] Simplify Ctrl+C signal handling --- handler/app.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/handler/app.py b/handler/app.py index c604ed8..9e74247 100755 --- a/handler/app.py +++ b/handler/app.py @@ -23,11 +23,7 @@ from money import Money init_map = None -def handler(sig, frame): - cleanup() - - -def cleanup(): +def cleanup(sig, frame): if init_map: try: init_map["tx"].lc_es_checks.stop() @@ -38,7 +34,7 @@ def cleanup(): reactor.stop() -signal(SIGINT, handler) # Handle Ctrl-C and run the cleanup routine +signal(SIGINT, cleanup) # Handle Ctrl-C and run the cleanup routine def convert(data):