SamG wrote: > import sys > try: > s=1 > if s==1: > sys.exit(0) > else: > sys.exit(1) > except SystemExit,s: > if (s==0): > print s > else: > print "Hello" > > How come i always end up getting the "Hello" printed on the screen as > logically i should a '0' printed?
After the exception is raised, s is not an int. It is an exception object. You want s.message. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list