From eac11c3bad8b2d515095a66e1657c0c728ee5120 Mon Sep 17 00:00:00 2001 From: Erethon Date: Thu, 13 Mar 2014 18:09:53 +0200 Subject: [PATCH] [units] Catch unhanlded exception if no user input * Catch two unhandled exceptions in distance and temp if the user specified no input. --- units.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/units.py b/units.py index f7eaeb789c..abf49f43d2 100644 --- a/units.py +++ b/units.py @@ -40,7 +40,7 @@ def temperature(bot, trigger): """ try: source = find_temp.match(trigger.group(2)).groups() - except AttributeError: + except (AttributeError, TypeError): bot.reply("That's not a valid temperature.") return NOLIMIT unit = source[1].upper() @@ -71,7 +71,7 @@ def distance(bot, trigger): """ try: source = find_length.match(trigger.group(2)).groups() - except AttributeError: + except (AttributeError, TypeError): bot.reply("That's not a valid length unit.") return NOLIMIT unit = source[1].lower()