This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Phillip.M.Feldman@gmail.com
Recipients Phillip.M.Feldman@gmail.com, georg.brandl, ggenellina, pitrou, r.david.murray, skip.montanaro
Date 2009-10-16.03:33:12
SpamBayes Score 0.000193945
Marked as misclassified No
Message-id <4AD7E973.4040504@verizon.net>
In-reply-to <1255653411.35.0.885397210024.issue3079@psf.upfronthosting.co.za>
Content
Thanks for the response!

I can indeed catch SystemExit, but I would like to be able to take one 
action (terminate the program) if the user supplied an unknown option, 
and another action (prompt for a new value) if the user supplied a bad 
value for an option.  I suspect that I can achieve this by subclassing, 
but I'm not yet at that level of Python sophistication.

Yours,

Phillip

R. David Murray wrote:
> R. David Murray <rdmurray@bitdance.com> added the comment:
>
> There was recently a long discussion of this on python-dev (in the
> context of a proposal to add argparse to the stdlib; argparse does the
> same thing).  The conclusion was that the current behavior is the most
> useful behavior, and that if you don't want to exit you can either
> subclass or catch SystemExit.
>
> ----------
> nosy: +r.david.murray
> resolution:  -> wont fix
> stage:  -> committed/rejected
> status: open -> closed
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue3079>
> _______________________________________
>
>
History
Date User Action Args
2009-10-16 03:33:14Phillip.M.Feldman@gmail.comsetrecipients: + Phillip.M.Feldman@gmail.com, skip.montanaro, georg.brandl, ggenellina, pitrou, r.david.murray
2009-10-16 03:33:12Phillip.M.Feldman@gmail.comlinkissue3079 messages
2009-10-16 03:33:12Phillip.M.Feldman@gmail.comcreate