'Call method() while capturing sys.stderr output internally and
call self.fail() if successRe.search() does not match the stderr
output.  This is used to test for uncatchable exceptions.'

def verifyStderr(self, method, successRe):

    stdErr = sys.stderr
    sys.stderr = StringIO()
    try:
        method()
    finally:
        temp = sys.stderr
        sys.stderr = stdErr
        errorOut = temp.getvalue()
        if (not successRe.search(errorOut)):
            self.fail(('unexpected    stderr    output:\n' + errorOut))
    if (sys.version_info < (3, 0)):
        sys.exc_traceback = sys.last_traceback = None
