📜  为什么 sys.exit 不起作用? - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:55.487000             🧑  作者: Mango

代码示例1
import sys

try:
    sys.exit() # this always raises SystemExit
except SystemExit:
    print("sys.exit() worked as expected")
except:
    print("Something went horribly wrong") # some other exception got raised