From b9524115b05bf0188d71689a5849b4492efa427b Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 27 Apr 2004 17:14:31 +0000 Subject: [PATCH] Fix for bug committed last night. --- src/Misc.py | 5 ++++- test/test_Misc.py | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Misc.py b/src/Misc.py index d457297a8..04012f166 100755 --- a/src/Misc.py +++ b/src/Misc.py @@ -60,7 +60,10 @@ class Misc(callbacks.Privmsg): command = tokens and tokens[0] or '' irc.error('%r is not a valid command.' % command) else: - self.log.info('Not replying to %s, not a command.' % tokens[0]) + if tokens: + # echo [] will get us an empty token set, but there's no need + # to log this in that case anyway, it being a nested command. + self.log.info('Not replying to %s, not a command.' % tokens[0]) if not isinstance(irc.irc, irclib.Irc): irc.reply('[%s]' % ' '.join(tokens)) diff --git a/test/test_Misc.py b/test/test_Misc.py index e408dfa89..c75d54339 100644 --- a/test/test_Misc.py +++ b/test/test_Misc.py @@ -161,6 +161,9 @@ class MiscTestCase(ChannelPluginTestCase): self.assertRegexp('more', 'more') self.assertNotRegexp('more', 'more') + def testInvalidCommand(self): + self.assertResponse('echo []', '[]') + def testMoreIsCaseInsensitive(self): self.assertNotError('echo %s' % ('abc'*2000)) self.assertNotError('more')