traceback.TracebackException.format_exception_only()

format_exception_only()

Format the exception part of the traceback.

The return value is a generator of strings, each ending in a newline.

Normally, the generator emits a single string; however, for SyntaxError exceptions, it emits several lines that (when printed) display detailed information about where the syntax error occurred.

The message indicating which exception occurred is always the last string in the output.

doc_python
2016-10-07 17:45:12
Comments
Leave a Comment

Please login to continue.