import sysprints
try:
try:
try:
raise SystemExit()
finally:
print "1:", sys.exc_info()
except:
print "2:", sys.exc_info()
raise
finally:
print "3:", sys.exc_info()
1: (None, None, None)This is not how I would expect it to work.
2: (<class exceptions.SystemExit ... )
3: (<class exceptions.SystemExit ... )
Upon closer inspection of the sys module's documentation:
exc_info()This contradicts to my common sense, but it is the way it is, so I'll have to find another solution for the problem at hand.
This function returns a tuple of three values that give information about the exception that is currently being handled.
Here, 'handling an exception' is defined as 'executing or having executed an except clause.'
No comments:
Post a Comment