def METHOD_NAME(self):
    saved_env = dict(os.environ)
    # Vcvars will change the directory after it runs in the situation when
    # the user has previously run the VS command console inits. In that
    # context it remembers the dir and resets it at each vcvars invocation.
    os.environ.update({"VSCMD_START_DIR": os.getcwd()})
    if not self.options.use_cxx_env:
        # To avoid using the CXX env vars we clear them out for the build.
        os.environ.update({
            "CXX": "",
            "CXXFLAGS": ""})
    try:
        yield
    finally:
        os.environ.clear()
        os.environ.update(saved_env)