user9843
0
Q:

why doesn't sys.exit work?

import sys

try:
    sys.exit() # this always raises SystemExit
except SystemExit:
    print("sys.exit() worked as expected")
except:
    print("Something went horribly wrong") # some other exception got raised
1

New to Communities?

Join the community