Systemexit
SystemExit is a built-in exception in Python that signals the interpreter to terminate execution. It is a subclass of BaseException and is raised either explicitly by the programmer via raise SystemExit(code) or implicitly by the standard library function sys.exit([code]).
Code semantics: When SystemExit is raised, the interpreter unwinds the call stack, runs finally blocks, and
Catching: SystemExit can be caught with a try/except block, using except SystemExit as e. In that case,
Relationship and usage: SystemExit is the conventional mechanism for terminating a Python program, distinct from signals