Fixed escaping ValueError in soundex.

This commit is contained in:
Jeremy Fincher 2003-10-22 20:09:45 +00:00
parent 5c1fc0114d
commit 9a5cb77fe4
1 changed files with 5 additions and 1 deletions

View File

@ -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))