Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Replace set with list when searching for installed program #23327

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading