Skip to content

Instantly share code, notes, and snippets.

@absent1706
Created April 12, 2021 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save absent1706/8a2a198a600f64435ef0064ad4a6a091 to your computer and use it in GitHub Desktop.
Save absent1706/8a2a198a600f64435ef0064ad4a6a091 to your computer and use it in GitHub Desktop.
def format_exception_as_python_does(e: BaseException):
# taken from https://stackoverflow.com/a/35498685
return traceback.format_exception(type(e), e, e.__traceback__)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment