I haven't checked if it's possible, but I suggest Argparse have it's own exception class that inherits from SystemExit and that exception would be thrown.
ParseError, or something similar. I suggest this just because it would be more readable I guess and would exactly explain why this code exits. On Sat, Oct 3, 2009 at 8:15 AM, Nick Coghlan <ncogh...@gmail.com> wrote: > Toshio Kuratomi wrote: >> About exit(), I agree with others about wanting to catch the exception >> myself and then choosing to exit from the code. I'm not sure that it's >> actually useful in practice, though...it might just feel cleaner but not >> actually be that helpful. > > As others have pointed out, if you want to do that then you can just > catch SystemExit. > > Cheers, > Nick. > > -- > Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia > --------------------------------------------------------------- > _______________________________________________ > Python-Dev mailing list > Python-Dev@python.org > http://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > http://mail.python.org/mailman/options/python-dev/ubershmekel%40gmail.com > _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com