From 9a5cb77fe4aea26edfc875f2cbff87e9c42fec1a Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Wed, 22 Oct 2003 20:09:45 +0000 Subject: [PATCH] Fixed escaping ValueError in soundex. --- plugins/Fun.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/Fun.py b/plugins/Fun.py index f9772fe5c..476f4781e 100644 --- a/plugins/Fun.py +++ b/plugins/Fun.py @@ -489,7 +489,11 @@ class Fun(callbacks.Privmsg): """ (s, length) = privmsgs.getArgs(args, optional=1) if length: - length = int(length) + try: + length = int(length) + except ValueError: + irc.error(msg, '%r isn\'t a valid length.') + return else: length = 4 irc.reply(msg, utils.soundex(s, length))