From a492bf2b3c5cfa75da8ff7f8320028a0f307fd0b Mon Sep 17 00:00:00 2001 From: "Lumberbot (aka Jack)" <39504233+meeseeksmachine@users.noreply.github.com> Date: Fri, 3 Jan 2025 06:25:27 -0800 Subject: [PATCH] Backport PR #23327 on branch 6.x (PR: Replace set with list when searching for installed program) (#23403) --- spyder/utils/programs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spyder/utils/programs.py b/spyder/utils/programs.py index b67a235fe90..591aa9b8c70 100644 --- a/spyder/utils/programs.py +++ b/spyder/utils/programs.py @@ -84,7 +84,6 @@ def is_program_installed(basename, extra_paths=[]): On macOS systems, a .app is considered installed if it exists. """ home = get_home_dir() - req_paths = [] if ( sys.platform == 'darwin' and basename.endswith('.app') @@ -110,9 +109,10 @@ def is_program_installed(basename, extra_paths=[]): 'Miniconda3', 'Anaconda3', 'Miniconda', 'Anaconda'] conda = [osp.join(*p, 'condabin') for p in itertools.product(a, b)] - req_paths.extend(pyenv + conda + extra_paths) - for path in set(os.environ['PATH'].split(os.pathsep) + req_paths): + for path in ( + extra_paths + conda + pyenv + os.getenv('PATH', []).split(os.pathsep) + ): abspath = osp.join(path, basename) if osp.isfile(abspath): return abspath