Skip to content

Commit

Permalink
Backport PR #23327 on branch 6.x (PR: Replace set with list when sear…
Browse files Browse the repository at this point in the history
…ching for installed program) (#23403)
  • Loading branch information
meeseeksmachine authored Jan 3, 2025
1 parent f78da07 commit a492bf2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spyder/utils/programs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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
Expand Down

0 comments on commit a492bf2

Please sign in to comment.