(self)
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.
Format the exception part of the traceback.
Format the exception part of the traceback .
def format_exception_only(self):
        """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.
        """
        if self.exc_type is None:
            yield _format_final_exc_line(None, self._str)
            return

        stype = self.exc_type.__qualname__
        smod = self.exc_type.__module__
        if smod not in ("__main__", "builtins"):
            if not isinstance(smod, str):
                smod = "<unknown>"
            stype = smod + '.' + stype

        if not issubclass(self.exc_type, SyntaxError):
            yield _format_final_exc_line(stype, self._str)
        else:
            yield from self._format_syntax_error(stype)
def format_exception_only ( self ) : if self . exc_type is None : yield _format_final_exc_line ( None , self . _str ) return stype = self . exc_type . __qualname__ smod = self . exc_type . __module__ if smod not in ( "__main__" , "builtins" ) : if not isinstance ( smod , str ) : smod = "<unknown>" stype = smod + '.' + stype if not issubclass ( self . exc_type , SyntaxError ) : yield _format_final_exc_line ( stype , self . _str ) else : yield from self . _format_syntax_error ( stype )