Simplify Ctrl+C signal handling

master
Mark Veidemanis 3 years ago
parent d261298bf7
commit ef5824892b
Signed by: m
GPG Key ID: 5ACFCEED46C0904F

@ -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):

Loading…
Cancel
Save