From 2aced1597422816136d5559b5101455d80ed5784 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 12 Dec 2015 15:28:29 -0800 Subject: [PATCH] Add timeout to prevent API calls from never returning --- forecastio/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forecastio/api.py b/forecastio/api.py index 39cfc5c..86f60b1 100644 --- a/forecastio/api.py +++ b/forecastio/api.py @@ -56,7 +56,7 @@ def manual(requestURL, callback=None): def get_forecast(requestURL): - forecastio_reponse = requests.get(requestURL) + forecastio_reponse = requests.get(requestURL, timeout=10) forecastio_reponse.raise_for_status() json = forecastio_reponse.json()