From 519abbbfa2b7bffdcb5c075ac7ec7bed535b2682 Mon Sep 17 00:00:00 2001 From: Ryan Kraus Date: Tue, 26 Jan 2016 22:41:57 -0500 Subject: [PATCH] Better handling of second KeyboardInterrupt Now the second KeyboardInterrupt will be cleanly handled by the parent process. --- homeassistant/__main__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/homeassistant/__main__.py b/homeassistant/__main__.py index 7da1e6658e1..ac9d5eabd70 100644 --- a/homeassistant/__main__.py +++ b/homeassistant/__main__.py @@ -258,7 +258,10 @@ def run_hass_process(hass_proc): hass_proc.join() except KeyboardInterrupt: request_stop() - hass_proc.join() + try: + hass_proc.join() + except KeyboardInterrupt: + return False return not requested_stop.isSet() and hass_proc.exitcode > 0