おわかりのように、プログラムが死んだはずの後でさえ、それは墓場から語りかけます。例外が発生した場合に exitfunction を「登録解除」する方法はありますか?
import atexit
def helloworld():
print("Hello World!")
atexit.register(helloworld)
raise Exception("Good bye cruel world!")
出力
Traceback (most recent call last):
File "test.py", line 8, in <module>
raise Exception("Good bye cruel world!")
Exception: Good bye cruel world!
Hello World!