def empty_environment(): """ Remove all variables from the environment. """ for s in list(os.environ.keys()): os.unsetenv(s) del os.environ[s]