bundles / IPython latest / 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