delayed sys.exit?

Dr. Phillip M. Feldman pfeldman at
Wed Jul 29 22:26:23 CEST 2009

In the attached 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.

In [126]: run test
Input a string: 1,2
[1, 2]

In [127]: run test
Input a string: 1-3
[1, 2, 3]

In [128]: run test
Input a string: 1,4,5-12
[1, 4, 5, 6, 7, 8, 9, 10, 11, 12]

In [129]: run test
Input a string: 0
ERROR: 0 is invalid; run numbers must be positive.
ERROR: '0' is not a valid run number.

View this message in context:
Sent from the Python - python-list mailing list archive at

More information about the Python-list mailing list