Fixed escaping ValueError in soundex.

This commit is contained in:
Jeremy Fincher 2003-10-22 20:09:45 +00:00
parent 5c1fc0114d
commit 9a5cb77fe4

View File

@ -489,7 +489,11 @@ class Fun(callbacks.Privmsg):
""" """
(s, length) = privmsgs.getArgs(args, optional=1) (s, length) = privmsgs.getArgs(args, optional=1)
if length: if length:
length = int(length) try:
length = int(length)
except ValueError:
irc.error(msg, '%r isn\'t a valid length.')
return
else: else:
length = 4 length = 4
irc.reply(msg, utils.soundex(s, length)) irc.reply(msg, utils.soundex(s, length))