diff --git a/src/MiscCommands.py b/src/MiscCommands.py index cb0c7c31d..7210a00cc 100755 --- a/src/MiscCommands.py +++ b/src/MiscCommands.py @@ -88,6 +88,7 @@ class MiscCommands(callbacks.Privmsg): lists all commands, not just the public ones. """ (optlist, rest) = getopt.getopt(args, '', ['private']) + evenPrivate = False for (option, argument) in optlist: if option == '--private': evenPrivate = True @@ -95,7 +96,7 @@ class MiscCommands(callbacks.Privmsg): name = name.lower() if not name: names = [cb.name() for cb in irc.callbacks - if evenPrivate or hasattr(cb, 'public') and cb.public] + if evenPrivate or (hasattr(cb, 'public') and cb.public)] names.sort() irc.reply(msg, ', '.join(names)) else: diff --git a/test/test_MiscCommands.py b/test/test_MiscCommands.py index 3d4dae99e..8d7462cb3 100644 --- a/test/test_MiscCommands.py +++ b/test/test_MiscCommands.py @@ -71,6 +71,7 @@ class MiscCommandsTestCase(ChannelPluginTestCase, PluginDocumentation): def testList(self): self.assertNotError('list MiscCommands') self.assertNotError('list misccommands') + self.assertNotError('list') # If Ctcp changes to public, these tests will break. So if # the next assert fails, change the plugin we test for public/private # to some other non-public plugin.