# HG changeset patch # User catherine.devlin@gmail.com # Date 1296651626 18000 # Node ID db32ab37051bd8128f97f8c37a8d788ea0bba603 # Parent a9f936346399f070d8e58c29c8ab18068ad09bfc use exception inheritence instead of listing all optparse exceptions diff -r a9f936346399 -r db32ab37051b cmd2.py --- a/cmd2.py Tue Feb 01 18:27:48 2011 -0500 +++ b/cmd2.py Wed Feb 02 08:00:26 2011 -0500 @@ -135,9 +135,7 @@ arg = arg.with_args_replaced(newArgs) else: arg = newArgs - except (optparse.OptionValueError, optparse.BadOptionError, - optparse.OptionError, optparse.AmbiguousOptionError, - optparse.OptionConflictError), e: + except optparse.OptParseError, e: print (e) optionParser.print_help() return