diff --git a/boa/__init__.py b/boa/__init__.py index 3e025e68..9f595984 100644 --- a/boa/__init__.py +++ b/boa/__init__.py @@ -41,16 +41,16 @@ def swap_env(new_env): yield -def set_env(new_env): +def _set_env(new): global env - get_env = lambda: env # noqa: E731 + env = new + Env._singleton = new - def setter(new): - global env - env = new - Env._singleton = new - return Open(get_env, setter, new_env) +def set_env(new_env): + global env + get_env = lambda: env # noqa: E731 + return Open(get_env, _set_env, new_env) def fork(