(typ, exc, tb)
Return line composing the exception message.
Return line composing the exception message.
Return line composing the exception message .
def get_message_lines(typ, exc, tb):
    "Return line composing the exception message."
    if typ in (AttributeError, NameError):
        # 3.10+ hints are not directly accessible from python (#44026).
        err = io.StringIO()
        with contextlib.redirect_stderr(err):
            sys.__excepthook__(typ, exc, tb)
        return [err.getvalue().split("\n")[-2] + "\n"]
    else:
        return traceback.format_exception_only(typ, exc)
def get_message_lines ( typ , exc , tb ) : if typ in ( AttributeError , NameError ) : # 3.10+ hints are not directly accessible from python (#44026). err = io . StringIO ( ) with contextlib . redirect_stderr ( err ) : sys . __excepthook__ ( typ , exc , tb ) return [ err . getvalue ( ) . split ( "\n" ) [ - 2 ] + "\n" ] else : return traceback . format_exception_only ( typ , exc )