Message94122
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>
> _______________________________________
>
> |
|
Date |
User |
Action |
Args |
2009-10-16 03:33:14 | Phillip.M.Feldman@gmail.com | set | recipients:
+ Phillip.M.Feldman@gmail.com, skip.montanaro, georg.brandl, ggenellina, pitrou, r.david.murray |
2009-10-16 03:33:12 | Phillip.M.Feldman@gmail.com | link | issue3079 messages |
2009-10-16 03:33:12 | Phillip.M.Feldman@gmail.com | create | |
|