def METHOD_NAME(self):
    import _lsprof
    # Must use a file as StringIO doesn't trigger the bug.
    orig_stderr = sys.stderr
    try:
        with open(TESTFN, 'w') as file:
            sys.stderr = file
            try:
                obj = _lsprof.Profiler(lambda: int)
                obj.enable()
                obj = _lsprof.Profiler(1)
                obj.disable()
                obj.clear()
            finally:
                sys.stderr = orig_stderr
    finally:
        unlink(TESTFN)