From d78afab58fdddf1cab0e916dcce7c209936bf88b Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Fri, 19 Jan 2024 10:34:35 -0500 Subject: [PATCH] Utils: Make get_spyder_conda_channel return a tuple of None's if fails - That's necessary to unpack its result correctly in the worker in charge of checking if a new Spyder version is available. - Also, improve a bit condition that checks the result of that function in the worker. --- spyder/utils/conda.py | 4 ++-- spyder/workers/updates.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spyder/utils/conda.py b/spyder/utils/conda.py index c1a68b242b9..3f909d89090 100644 --- a/spyder/utils/conda.py +++ b/spyder/utils/conda.py @@ -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]) @@ -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': diff --git a/spyder/workers/updates.py b/spyder/workers/updates.py index b81d6598392..b10ad11c6b7 100644 --- a/spyder/workers/updates.py +++ b/spyder/workers/updates.py @@ -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