> > In the attached http://www.nabble.com/file/p24726902/test.py test.py > code, > it appears that additional statements execute after the call to > sys.exit(0). > I'll be grateful if anyone can shed light on why this is happening. Below > is a copy of some sample I/O. Note that in the last case I get additional > output after what should be the final error message. >
A bare "except:" catches ALL exceptions; including SystemExit which is generated by sys.exit. And KeyboardInterrupt, too. That's why its basically a bad idea to use bare excepts unless you really, really, really need to. Try 'except Exception' instead. SystemExit and such do not inherit from Exception. --S
-- http://mail.python.org/mailman/listinfo/python-list