From ff301e491b44376901e41e50a7aa3996ba6b44db Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Mon, 10 Jun 2024 10:38:24 -0500 Subject: [PATCH] Utils: Fix error when we can't detect Spyder in `conda list` output --- spyder/utils/conda.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spyder/utils/conda.py b/spyder/utils/conda.py index a0da5089315..cdc3e213c8b 100644 --- a/spyder/utils/conda.py +++ b/spyder/utils/conda.py @@ -232,6 +232,11 @@ def get_spyder_conda_channel(): if 'error' in out: return None, None + # These variables can be unassigned after the next for, so we need to give + # them a default value at this point. + # Fixes spyder-ide/spyder#22054 + channel, channel_url = None, None + for package_info in out: if package_info["name"] == 'spyder': channel = package_info["channel"]