From a6371e0052274ced1f79aee70eb070b74e81543f Mon Sep 17 00:00:00 2001 From: Daniel Pizetta Date: Mon, 15 Apr 2024 10:56:02 -0300 Subject: [PATCH] Avoids iterating over non-dict objects if conda responds with errors Original source problem: Traceback (most recent call last): File "/home/pizetta/miniconda3/envs/ciermag-develop/lib/python3.11/site-packages/spyder/workers/updates.py", line 119, in start channel, channel_url = get_spyder_conda_channel() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pizetta/miniconda3/envs/ciermag-develop/lib/python3.11/site-packages/spyder/utils/conda.py", line 235, in get_spyder_conda_channel if package_info["name"] == 'spyder': ~~~~~~~~~~~~^^^^^^^^ TypeError: string indices must be integers, not 'str' --- spyder/utils/conda.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spyder/utils/conda.py b/spyder/utils/conda.py index 55a35ccf252..a0da5089315 100644 --- a/spyder/utils/conda.py +++ b/spyder/utils/conda.py @@ -228,6 +228,10 @@ def get_spyder_conda_channel(): except Exception: return None, None + # Avoids iterating over non-dict objects + if 'error' in out: + return None, None + for package_info in out: if package_info["name"] == 'spyder': channel = package_info["channel"]