Answers for "why doesn't sys.exit work?"

1

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
Posted by: Guest on June-17-2020
1

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
Posted by: Guest on June-17-2020

Code answers related to "why doesn't sys.exit work?"

Browse Popular Code Answers by Language