You are viewing an older version (9.11.0). Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython 9.11.0 / IPython / core / ultratb / ListTB / _format_exception_only

function

IPython.core.ultratb:ListTB._format_exception_only

source: /IPython/core/ultratb.py :290

Signature

def   _format_exception_only ( self etype : type[BaseException] value : BaseException | None )  →  list[str]

Summary

Format the exception part of a traceback.

Extended Summary

The arguments are the exception type and value such as given by sys.exc_info()[:2]. The return value is a list of strings, each ending in a newline. Normally, the list contains a single string; however, for SyntaxError exceptions, it contains several lines that (when printed) display detailed information about where the syntax error occurred. The message indicating which exception occurred is the always last string in the list.

Also lifted nearly verbatim from traceback.py

Aliases

  • IPython.core.ultratb.ListTB._format_exception_only