let's see the official documentation: https://docs.python.org/3/tutorial/errors.html#defining-clean-up-actions