'Helper to build a C{Failure} with some traceback.
@param error: An C{Exception} instance.
@param error: The class name of the C{error} class.
@param frames: A flat list of strings representing the information need
to approximatively rebuild C{Failure} frames.
@return: A L{Failure} instance with enough information about a test
error.'

def _buildFailure(self, error, errorClass, frames):

    if _PY3:
        errorClass = errorClass.decode('utf-8')
    errorType = namedObject(errorClass)
    failure = Failure(error, errorType)
    for i in range(0, len(frames), 3):
        failure.frames.append((frames[i], frames[(i + 1)], int(frames[(i + 2)]), [], []))
    return failure
