From f668589fcbede939b7021181ab468efc042b1076 Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Sat, 24 Aug 2013 19:12:15 -0700 Subject: [PATCH] weather: fix error handling (caused breakage) --- modules/weather.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/weather.py b/modules/weather.py index 555b64e..61c083e 100644 --- a/modules/weather.py +++ b/modules/weather.py @@ -22,7 +22,7 @@ def location(q): results = web.get(uri) data = json.loads(results) - if not 'display_name' in data: + if len(data) < 1: return '?', None, None display_name = data[0]['display_name']