Skip to content

Commit

Permalink
Raise timeout threshold and cache result for get_user_environment_var…
Browse files Browse the repository at this point in the history
…iables.
  • Loading branch information
mrclary committed Dec 13, 2024
1 parent 80f6954 commit 697827f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions spyder/utils/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def listdict2envdict(listdict):
return listdict


@lru_cache
def get_user_environment_variables():
"""
Get user environment variables from a subprocess.
Expand Down Expand Up @@ -117,9 +118,7 @@ def get_user_environment_variables():
proc = run_shell_command(user_env_script, env={}, text=True)

# Use timeout to fix spyder-ide/spyder#21172
stdout, stderr = proc.communicate(
timeout=3 if running_in_ci() else 0.5
)
stdout, stderr = proc.communicate(timeout=3)

if stderr:
logger.info(stderr.strip())
Expand Down

0 comments on commit 697827f

Please sign in to comment.