I am trying to catch a SystemExit
exception in the following fashion:
try:
raise SystemExit
except Exception as exception:
print "success"
But, it doesn't work.
It does work however when I change my code like that:
try:
raise SystemExit
except:
print "success"
As far as I am aware, except Exception as exception
should catch any exception. This is how it is described here as well. Why isn't that working for me here?