From 027b4af6431ef85a2b15f51a2052415e26fb7551 Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Fri, 3 Jan 2025 08:18:08 -0500 Subject: [PATCH] Backport PR #23327: PR: Replace set with list when searching for installed program --- 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