I am trying to catch a SystemExit exception like this:
try: raise SystemExit except Exception as exception: print "success"
But that does not work.
It really works when I change my code as follows:
try: raise SystemExit except: print "success"
As far as I know, except Exception as exception should catch any exception. Here is how it is described here . Why does this not work for me here?
python exception exception-handling
Eugene s
source share