From 4030026c4c73c6f0fa7e130916d26a329aeddf9c Mon Sep 17 00:00:00 2001 From: James Vega Date: Thu, 10 Feb 2005 03:15:02 +0000 Subject: [PATCH] Catch the proper errors when a field isn't found. --- plugins/Weather/plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Weather/plugin.py b/plugins/Weather/plugin.py index ae699430d..f28e2b5ae 100644 --- a/plugins/Weather/plugin.py +++ b/plugins/Weather/plugin.py @@ -412,7 +412,7 @@ class Weather(callbacks.Plugin): else: dew = deg.join((dew, unit)) resp.append('Dew Point: %s.' % dew) - except ValueError: + except (ValueError, KeyError): pass try: resp.append('Wind: %s at %s %s.' % tuple(info['Wind'].split())) @@ -425,7 +425,7 @@ class Weather(callbacks.Plugin): else: dew = deg.join((chill, unit)) resp.append('Windchill: %s.' % chill) - except (ValueError, TypeError): + except (ValueError, KeyError): pass if info['Pressure']: resp.append('Pressure: %s.' % info['Pressure'])