From 1988b5ed79fc5407457492f1fbdc5420a09286db Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 28 Sep 2013 14:55:03 -0700 Subject: [PATCH] Sometimes the HTTP interface wouldn't manage to shut its threads down. --- homeassistant/httpinterface.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/homeassistant/httpinterface.py b/homeassistant/httpinterface.py index dc486190383..79cdb5b5077 100644 --- a/homeassistant/httpinterface.py +++ b/homeassistant/httpinterface.py @@ -74,7 +74,10 @@ class HTTPInterface(threading.Thread): self._stop.set() # Trigger a fake request to get the server to quit - requests.get("http://127.0.0.1:{}".format(SERVER_PORT)) + try: + requests.get("http://127.0.0.1:{}".format(SERVER_PORT), timeout=0.001) + except requests.TimeOut: + pass class RequestHandler(BaseHTTPRequestHandler): """ Handles incoming HTTP requests """