From d13f0f45c51e7f07ae13dfa8a32e1b175a9d91cb Mon Sep 17 00:00:00 2001 From: bakamake Date: Wed, 6 May 2026 09:11:23 +0800 Subject: [PATCH] fix(tools): idf_tools.py uninstall: initialize archive_version before use Closes https://github.com/espressif/esp-idf/pull/18556 --- tools/idf_tools.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/idf_tools.py b/tools/idf_tools.py index f0ecea3027c..f618a98ecbc 100755 --- a/tools/idf_tools.py +++ b/tools/idf_tools.py @@ -3214,6 +3214,7 @@ def action_uninstall(args: Any) -> None: else: tool_name, tool_version = tool_spec.split('@', 1) tool_obj = tools_info_for_platform[tool_name] + archive_version = None if tool_version is None: tool_version = tool_obj.get_preferred_installed_version() # mypy-checks @@ -3221,9 +3222,8 @@ def action_uninstall(args: Any) -> None: archive_version = tool_obj.versions[tool_version].get_download_for_platform(CURRENT_PLATFORM) if archive_version is not None: archive_version_url = archive_version.url - - archive = os.path.basename(archive_version_url) - used_archives.append(archive) + archive = os.path.basename(archive_version_url) + used_archives.append(archive) downloaded_archives = os.listdir(dist_path) for archive in downloaded_archives: