From ab562416bf8a36aaa3f2557e7bd9e6ded5256943 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 26 Aug 2003 13:44:32 +0000 Subject: [PATCH] Added getopt.GetoptError to exceptions to return help on. --- src/callbacks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/callbacks.py b/src/callbacks.py index 5131634f9..da7f168a0 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -45,6 +45,7 @@ import new import sets import time import shlex +import getopt import inspect import threading import sre_constants @@ -298,7 +299,7 @@ class IrcObjectProxy: # If self.irc is an actual irclib.Irc, then this is the # first command given, and should be ignored as usual. self.reply(self.msg, '[%s]' % ' '.join(self.args)) - except ArgumentError: + except (getopt.GetoptError, ArgumentError): if hasattr(command, '__doc__'): s = '%s %s' % (name, command.__doc__.splitlines()[0]) else: @@ -365,7 +366,7 @@ class CommandThread(threading.Thread): elapsed = time.time() - start debug.msg('%s took %s seconds.' % \ (self.commandName, elapsed), 'verbose') - except ArgumentError: + except (getopt.GetoptError, ArgumentError): if hasattr(self.command, '__doc__'): help = self.command.__doc__.splitlines()[0] s = '%s %s' % (self.commandName, help)