how do I exit gracefully?

Thomas A. Bryan tbryan at python.com
Sat Oct 28 23:21:39 EDT 2000


Andrew Dalke wrote:
> 
> Thomas A. Bryan wrote:
> >sys.exit() should exit the program, not raise an exception.
> 
> That is not correct.
> 
> >>>> raise ValueError
> >Traceback (innermost last):
> >  File "<stdin>", line 1, in ?
> >ValueError
> >>>> import sys
> >>>> sys.exit(0)
> >$
> 
> All that example proves is that the top-level handler doesn't catch the
> SystemExit exception.  Consider

Wow!  Thanks.  Perhaps I'll check the docs next time before I post.  

blushing-and-digging-out-a-dusty-copy-of-the-docs-ly yours

---Tom



More information about the Python-list mailing list