'Initialize me with an explanation of the error.
By default, this will use the current C{exception}
(L{sys.exc_info}()).  However, if you want to specify a
particular kind of failure, you can pass an exception as an
argument.
If no C{exc_value} is passed, then an "original" C{Failure} will
be searched for. If the current exception handler that this
C{Failure} is being constructed in is handling an exception
raised by L{raiseException}, then this C{Failure} will act like
the original C{Failure}.
For C{exc_tb} only L{traceback} instances or L{None} are allowed.
If L{None} is supplied for C{exc_value}, the value of C{exc_tb} is
ignored, otherwise if C{exc_tb} is L{None}, it will be found from
execution context (ie, L{sys.exc_info}).
@param captureVars: if set, capture locals and globals of stack
frames.  This is pretty slow, and makes no difference unless you
are going to use L{printDetailedTraceback}.'

def __init__(self, exc_value=None, exc_type=None, exc_tb=None, captureVars=False):

    global count
    count = (count + 1)
    self.count = count
    self.type = self.value = tb = None
    self.captureVars = captureVars
    if (isinstance(exc_value, str) and (exc_type is None)):
        raise TypeError('Strings    are    not    supported    by    Failure')
    stackOffset = 0
    if (exc_value is None):
        exc_value = self._findFailure()
    if (exc_value is None):
        (self.type, self.value, tb) = sys.exc_info()
        if (self.type is None):
            raise NoCurrentExceptionError()
        stackOffset = 1
    elif (exc_type is None):
        if isinstance(exc_value, Exception):
            self.type = exc_value.__class__
        else:
            self.type = type(exc_value)
        self.value = exc_value
    else:
        self.type = exc_type
        self.value = exc_value
    if isinstance(self.value, Failure):
        self.__dict__ = self.value.__dict__
        return
    if (tb is None):
        if exc_tb:
            tb = exc_tb
        elif getattr(self.value, '__traceback__', None):
            tb = self.value.__traceback__
    frames = self.frames = []
    stack = self.stack = []
    self.tb = tb
    if tb:
        f = tb.tb_frame
    elif (not isinstance(self.value, Failure)):
        f = stackOffset = None
    while (stackOffset and f):
        f = f.f_back
        stackOffset -= 1
    while f:
        if captureVars:
            localz = f.f_locals.copy()
            if (f.f_locals is f.f_globals):
                globalz = {}
            else:
                globalz = f.f_globals.copy()
            for d in (globalz, localz):
                if ('__builtins__' in d):
                    del d['__builtins__']
            localz = localz.items()
            globalz = globalz.items()
        else:
            localz = globalz = ()
        stack.insert(0, (f.f_code.co_name, f.f_code.co_filename, f.f_lineno, localz, globalz))
        f = f.f_back
    while (tb is not None):
        f = tb.tb_frame
        if captureVars:
            localz = f.f_locals.copy()
            if (f.f_locals is f.f_globals):
                globalz = {}
            else:
                globalz = f.f_globals.copy()
            for d in (globalz, localz):
                if ('__builtins__' in d):
                    del d['__builtins__']
            localz = list(localz.items())
            globalz = list(globalz.items())
        else:
            localz = globalz = ()
        frames.append((f.f_code.co_name, f.f_code.co_filename, tb.tb_lineno, localz, globalz))
        tb = tb.tb_next
    if (inspect.isclass(self.type) and issubclass(self.type, Exception)):
        parentCs = getmro(self.type)
        self.parents = list(map(reflect.qual, parentCs))
    else:
        self.parents = [self.type]
