From 3d993a0cabe41a63223e2a6c5f3e8639de643d39 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sun, 29 Jun 2014 19:12:22 -0400 Subject: [PATCH] callbacks: Properly handle nested command errors Using Raise=True was only papering over the real problem in the nested command error handling. The actual issue is that we were trying to return an IrcMsg from NestedCommandsIrcProxy.__init__. Dropping Raise=True and moving return to its own line is the correct fix and resolves the test failure in testMaximumNestingDepth. This commit reverts 7838cae3bc5f23c271c8baba0630d6969d8f1b55 Signed-off-by: James McCoy --- src/callbacks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/callbacks.py b/src/callbacks.py index dcae2e203..b52d3e726 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -587,8 +587,9 @@ class NestedCommandsIrcProxy(ReplyIrcProxy): if maxNesting and self.nested > maxNesting: log.warning('%s attempted more than %s levels of nesting.', self.msg.prefix, maxNesting) - return self.error('You\'ve attempted more nesting than is ' - 'currently allowed on this bot.', Raise=True) + self.error('You\'ve attempted more nesting than is ' + 'currently allowed on this bot.') + return # The deepcopy here is necessary for Scheduler; it re-runs already # tokenized commands. There's a possibility a simple copy[:] would # work, but we're being careful.