mirror of
https://github.com/powerline/powerline.git
synced 2025-07-23 05:46:01 +02:00
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…
x
Reference in New Issue
Block a user