Take a look at the traceback module. You could do the following:
import sys, traceback
try:
raise Exception()
except:
traceback.print_exc()
sys.exit(3)
This will write traceback to standard error and exit with code 3.
Take a look at the traceback module. You could do the following:
import sys, traceback
try:
raise Exception()
except:
traceback.print_exc()
sys.exit(3)
This will write traceback to standard error and exit with code 3.