# Add a dunder function __exit__ def __exit__(self, exc_type, exc_value, traceback): print(" within __exit__") print(" Traceback:", traceback)