Phillip M. Feldman <pfeld...@verizon.net> added the comment:

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 <rdmur...@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 <rep...@bugs.python.org>
> <http://bugs.python.org/issue3079>
> _______________________________________
>
>

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue3079>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to