Skip to content

Commit

Permalink
Clear cache for get_user_environment_variables when changing system t…
Browse files Browse the repository at this point in the history
…o ensure next call will retrieve the new change
  • Loading branch information
mrclary committed Dec 14, 2024
1 parent 697827f commit 6889041
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spyder/utils/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,11 @@ def set_user_env(env, parent=None):
"Please restart this Windows <i>session</i> "
"(not the computer) for changes to take effect.")
)
get_user_environment_variables.cache_clear()
elif os.name == 'posix' and running_in_ci():
text = "\n".join([f"export {k}={v}" for k, v in env_dict.items()])
amend_user_shell_init(text)
get_user_environment_variables.cache_clear()
else:
raise NotImplementedError("Not implemented for platform %s", os.name)

Expand Down

0 comments on commit 6889041

Please sign in to comment.