def make_exception_message ( exc ) : if str ( exc ) : return '%s: %s\n' % ( exc . __class__ . __name__ , exc ) else : return '%s\n' % ( exc . __class__ . __name__ )
python excetion text on several lines
An exception is passed in and this function returns the proper string depending on the result so it is readable enough .
def make_exception_message(exc):
    """
    An exception is passed in and this function
    returns the proper string depending on the result
    so it is readable enough.
    """
    if str(exc):
        return '%s: %s\n' % (exc.__class__.__name__, exc)
    else:
        return '%s\n' % (exc.__class__.__name__)