def exceptions_equal(exception1, exception2):
    """Returns True if the exceptions have the same type and message"""
    # pylint: disable=unidiomatic-typecheck
    return type(exception1) == type(exception2) and str(exception1) == str(exception2)