From 84690d56c9a06e6dd08f75fb6b08d88dc18aa4a6 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 | 2 +- test/test_Fun.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/Fun.py b/plugins/Fun.py index 476f4781e..11ddbf45d 100644 --- a/plugins/Fun.py +++ b/plugins/Fun.py @@ -492,7 +492,7 @@ class Fun(callbacks.Privmsg): try: length = int(length) except ValueError: - irc.error(msg, '%r isn\'t a valid length.') + irc.error(msg, '%r isn\'t a valid length.' % length) return else: length = 4 diff --git a/test/test_Fun.py b/test/test_Fun.py index 71281ef64..217c8ee31 100644 --- a/test/test_Fun.py +++ b/test/test_Fun.py @@ -42,7 +42,10 @@ class FunTest(PluginTestCase, PluginDocumentation): self.assertNotError('lithp meghan sweeney') self.assertNotError('objects') self.assertNotError('levenshtein Python Perl') + + def testSoundex(self): self.assertNotError('soundex jemfinch') + self.assertNotRegexp('soundex foobar 3:30', 'ValueError') def testJeffk(self): for i in range(100):