@contextmanager
def LocalEnv(local_env):
  old_env = os.environ.copy()
  os.environ.update(local_env)
  try:
    yield
  finally:
    os.environ.clear()
    os.environ.update(old_env)
Context manager to provide a local OS environment.
dataset/ETHPy150Open adblockplus/gyp/test/lib/TestGyp.py/LocalEnv