diff --git a/compilesketches/compilesketches.py b/compilesketches/compilesketches.py index a02cad5..00236a8 100644 --- a/compilesketches/compilesketches.py +++ b/compilesketches/compilesketches.py @@ -1453,6 +1453,11 @@ def cli_core_list_platform_list(self, data): or semver.Version.parse(version=self.cli_version).compare(other=first_new_interface_version) >= 0 ): # cli_version is either "latest" (which will now always be >=1.0.0) or an explicit version >=1.0.0 + + # Workaround for https://github.com/arduino/arduino-cli/issues/2690 + if data["platforms"] is None: + return [] + return data["platforms"] return data diff --git a/compilesketches/tests/test_compilesketches.py b/compilesketches/tests/test_compilesketches.py index 0563dda..95ed1e1 100644 --- a/compilesketches/tests/test_compilesketches.py +++ b/compilesketches/tests/test_compilesketches.py @@ -2886,6 +2886,7 @@ def test_create_sketches_report_file(monkeypatch, tmp_path): @pytest.mark.parametrize( "cli_version, data, assertion", [ + ("latest", {"platforms": None}, []), # Non-semver ("latest", {"platforms": [unittest.mock.sentinel.list_item]}, [unittest.mock.sentinel.list_item]), # Non-semver ("2.0.0", {"platforms": [unittest.mock.sentinel.list_item]}, [unittest.mock.sentinel.list_item]), # > ("1.0.0", {"platforms": [unittest.mock.sentinel.list_item]}, [unittest.mock.sentinel.list_item]), # ==