Why "except Exception" doesn't catch SystemExit?
--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game Looping
--
Chapters
00:00 Why &Quot;Except Exception&Quot; Doesn'T Catch Systemexit?
00:22 Answer 1 Score 8
00:36 Answer 2 Score 11
01:01 Accepted Answer Score 13
01:21 Thank you
--
Full question
https://stackoverflow.com/questions/5714...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #exceptionhandling
#avk47
    Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game Looping
--
Chapters
00:00 Why &Quot;Except Exception&Quot; Doesn'T Catch Systemexit?
00:22 Answer 1 Score 8
00:36 Answer 2 Score 11
01:01 Accepted Answer Score 13
01:21 Thank you
--
Full question
https://stackoverflow.com/questions/5714...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #exceptionhandling
#avk47
ACCEPTED ANSWER
Score 13
isinstance(SystemExit(1), Exception)
is False on Python 2.6. Exception hierarchy in this version of Python was changed since Python 2.4. 
E.g. KeyboardInterrupt is not subclass of Exception any more.
See more info http://docs.python.org/release/2.6.6/library/exceptions.html#exception-hierarchy
ANSWER 2
Score 11
SystemExit derives from BaseException directly rather than from Exception.
Exception is the parent "All built-in, non-system-exiting exceptions"
SystemExit is a "system exiting exception" (by definition) and therefore doesn't derive from Exception. In your example, if you used BaseException, it would work as per your original assumptions.
ANSWER 3
Score 8
Your error is in the very first sentence of your question:
>>> isinstance(SystemExit(1), Exception)
False
SystemExit is not a subclass of Exception.