Author bethard
Recipients bethard, docs@python, eric.araujo, jayt, tanqazx
Date 2010-12-17.15:58:02
SpamBayes Score 0.000512694
Marked as misclassified No
Message-id <1292601483.99.0.153251138845.issue9938@psf.upfronthosting.co.za>
In-reply-to
Content
In the short term, just catch the SystemExit.

In the slightly longer term, we could certainly provide a subclass, say, ErrorRaisingArgumentParser, that overrides .exit and .error to do nothing but raise an exception with the message they would have printed. We'd probably have to introduce a new Exception subclass though, maybe ArgumentParserExit or something like that.

Anyway if you're interested in this, please file a new ticket (preferably  with a patch). Regardless of whether we ever provide the subclass, we certainly need to patch the documentation to tell people how to override error and exit.
History
Date User Action Args
2010-12-17 15:58:04bethardsetrecipients: + bethard, eric.araujo, docs@python, jayt, tanqazx
2010-12-17 15:58:03bethardsetmessageid: <1292601483.99.0.153251138845.issue9938@psf.upfronthosting.co.za>
2010-12-17 15:58:02bethardlinkissue9938 messages
2010-12-17 15:58:02bethardcreate