From e421722960267cabed14d9b8c09dcf5dcc5a0c42 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Fri, 23 Aug 2013 22:06:07 -0400 Subject: [PATCH] Fix crash if a custom error message is provided to somethingWithoutSpaces Signed-off-by: James McCoy --- src/commands.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/commands.py b/src/commands.py index 71d66a45b..6f4675679 100644 --- a/src/commands.py +++ b/src/commands.py @@ -504,11 +504,12 @@ def getSomething(irc, msg, args, state, errorMsg=None, p=None): else: state.args.append(args.pop(0)) -def getSomethingNoSpaces(irc, msg, args, state, *L): +def getSomethingNoSpaces(irc, msg, args, state, errorMsg=None): def p(s): return len(s.split(None, 1)) == 1 - errmsg = 'You must not give a string containing spaces as an argument.' - getSomething(irc, msg, args, state, p=p, errorMsg=errmsg, *L) + if errorMsg is None: + errorMsg='You must not give a string containing spaces as an argument.' + getSomething(irc, msg, args, state, errorMsg=errorMsg, p=p) def private(irc, msg, args, state): if irc.isChannel(msg.args[0]):