icon: package
traceback.print_exc() -> NonePrint the exception currently being handled and its traceback. This also works from helper functions called by an exception handler. If no exception is being handled, print nothing.
traceback.format_exc() -> str | NoneReturn the exception currently being handled and its traceback as a string.
This uses the same exception as print_exc(), including inside helper functions
and nested try blocks. Return None if no exception is being handled.