Catch more errors in weather segment

This commit is contained in:
Kim Silkebækken 2013-02-06 09:10:40 +01:00
parent 9a95d738d5
commit 4fa17f6ff5
1 changed files with 1 additions and 1 deletions

View File

@ -144,7 +144,7 @@ def weather(unit='c', location_query=None):
response = json.loads(_urllib_read(url))
condition = response['query']['results']['weather']['rss']['channel']['item']['condition']
condition_code = int(condition['code'])
except (KeyError, ValueError):
except (KeyError, TypeError, ValueError):
return None
icon = u''
for icon, codes in weather_conditions_codes.items():