Skip to content

Commit

Permalink
Merge pull request #21723 from ccordoba12/issue-21711
Browse files Browse the repository at this point in the history
PR: Make `get_spyder_conda_channel` return a tuple of None's if it fails (Utils)
  • Loading branch information
ccordoba12 authored Jan 19, 2024
2 parents 26b9bb4 + d78afab commit 5ae26aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions spyder/utils/conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def get_spyder_conda_channel():
conda = find_conda()

if conda is None:
return None
return None, None

env = get_conda_env_path(sys.executable)
cmdstr = ' '.join([conda, 'list', 'spyder', '--json', '--prefix', env])
Expand All @@ -213,7 +213,7 @@ def get_spyder_conda_channel():
out = out.decode()
out = json.loads(out)
except Exception:
return None
return None, None

for package_info in out:
if package_info["name"] == 'spyder':
Expand Down
2 changes: 1 addition & 1 deletion spyder/workers/updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def start(self):
elif is_anaconda():
channel, channel_url = get_spyder_conda_channel()

if channel_url is None:
if channel is None or channel_url is None:
return
elif channel == "pypi":
self.url = pypi_url
Expand Down

0 comments on commit 5ae26aa

Please sign in to comment.