Catch more errors in weather segment
This commit is contained in:
parent
9a95d738d5
commit
4fa17f6ff5
|
@ -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():
|
||||
|
|
Loading…
Reference in New Issue