mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-10 12:59:22 +01:00
Fixed Bug #833786 (spurious brackets not handled correctly).
This commit is contained in:
parent
ca8b17f909
commit
8c93488146
@ -85,7 +85,10 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
|
||||
def __init__(self):
|
||||
callbacks.Privmsg.__init__(self)
|
||||
setattr(self.__class__, 'exec', self.__class__._exec)
|
||||
self.defaultPlugins = {'join', 'admin'}
|
||||
self.defaultPlugins = {'join': 'admin',
|
||||
'load': 'owner',
|
||||
'reload': 'owner',
|
||||
'unload': 'owner'}
|
||||
|
||||
def _disambiguate(self, tokens):
|
||||
if tokens:
|
||||
@ -100,7 +103,11 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
|
||||
callbacks.Privmsg.handled = False
|
||||
s = callbacks.addressed(irc.nick, msg)
|
||||
if s:
|
||||
try:
|
||||
tokens = callbacks.tokenize(s)
|
||||
except SyntaxError, e:
|
||||
irc.queueMsg(callbacks.error(msg, str(e)))
|
||||
return
|
||||
self._disambiguate(tokens)
|
||||
ambiguousCommands = {}
|
||||
commands = callbacks.getCommands(tokens)
|
||||
|
@ -297,6 +297,9 @@ class PrivmsgTestCase(ChannelPluginTestCase):
|
||||
finally:
|
||||
conf.commandsOnStart = original
|
||||
|
||||
def testSyntaxErrorNotEscaping(self):
|
||||
self.assertError('load [foo')
|
||||
self.assertError('load foo]')
|
||||
|
||||
|
||||
class PrivmsgCommandAndRegexpTestCase(PluginTestCase):
|
||||
|
Loading…
Reference in New Issue
Block a user