From: Ivan Grokhotkov Date: Tue, 23 Jul 2019 04:55:30 +0000 (+0200) Subject: tools: idf_tools.py: improve error message when no downloads found X-Git-Tag: v4.0-beta1~45^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b70ac4deb7e6fa27aa2a930cd7db0963a29515f7;p=esp-idf tools: idf_tools.py: improve error message when no downloads found ...for the given platform. Previously would raise AssertionError. --- diff --git a/tools/idf_tools.py b/tools/idf_tools.py index 7cdd182366..b5cfb08038 100755 --- a/tools/idf_tools.py +++ b/tools/idf_tools.py @@ -441,6 +441,9 @@ class IDFTool(object): def get_install_type(self): return self._current_options.install + def compatible_with_platform(self): + return any([v.compatible_with_platform() for v in self.versions.values()]) + def get_recommended_version(self): recommended_versions = [k for k, v in self.versions.items() if v.status == IDFToolVersion.STATUS_RECOMMENDED @@ -1030,6 +1033,9 @@ def action_install(args): fatal('unknown tool name: {}'.format(tool_name)) raise SystemExit(1) tool_obj = tools_info[tool_name] + if not tool_obj.compatible_with_platform(): + fatal('tool {} does not have versions compatible with platform {}'.format(tool_name, CURRENT_PLATFORM)) + raise SystemExit(1) if tool_version is not None and tool_version not in tool_obj.versions: fatal('unknown version for tool {}: {}'.format(tool_name, tool_version)) raise SystemExit(1)