From 79c3232d08484f7fb2a9e55df024791e8d5e9b69 Mon Sep 17 00:00:00 2001 From: Ferry Boender Date: Mon, 7 Sep 2020 17:14:40 +0200 Subject: [PATCH] Don't show traceback when interrupting with ctrl-c --- src/scriptform.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/scriptform.py b/src/scriptform.py index a60c305..98cf3ff 100755 --- a/src/scriptform.py +++ b/src/scriptform.py @@ -117,7 +117,10 @@ class ScriptForm(object): self.httpd.daemon_threads = True self.log.info("Listening on %s:%s", listen_addr, listen_port) self.running = True - self.httpd.serve_forever() + try: + self.httpd.serve_forever() + except KeyboardInterrupt: + pass self.running = False def shutdown(self):