Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8ac27e9

Browse filesBrowse files
authored
Merge pull request #311 from per1234/handle-core-list-null
Handle inappropriate `null` output from `arduino-cli core list` when no platforms are installed
2 parents 5932bd0 + 8107fc9 commit 8ac27e9
Copy full SHA for 8ac27e9

File tree

Expand file treeCollapse file tree

2 files changed

+6
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-0
lines changed

‎compilesketches/compilesketches.py

Copy file name to clipboardExpand all lines: compilesketches/compilesketches.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,6 +1453,11 @@ def cli_core_list_platform_list(self, data):
14531453
or semver.Version.parse(version=self.cli_version).compare(other=first_new_interface_version) >= 0
14541454
):
14551455
# cli_version is either "latest" (which will now always be >=1.0.0) or an explicit version >=1.0.0
1456+
1457+
# Workaround for https://github.com/arduino/arduino-cli/issues/2690
1458+
if data["platforms"] is None:
1459+
return []
1460+
14561461
return data["platforms"]
14571462

14581463
return data

‎compilesketches/tests/test_compilesketches.py

Copy file name to clipboardExpand all lines: compilesketches/tests/test_compilesketches.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2886,6 +2886,7 @@ def test_create_sketches_report_file(monkeypatch, tmp_path):
28862886
@pytest.mark.parametrize(
28872887
"cli_version, data, assertion",
28882888
[
2889+
("latest", {"platforms": None}, []), # Non-semver
28892890
("latest", {"platforms": [unittest.mock.sentinel.list_item]}, [unittest.mock.sentinel.list_item]), # Non-semver
28902891
("2.0.0", {"platforms": [unittest.mock.sentinel.list_item]}, [unittest.mock.sentinel.list_item]), # >
28912892
("1.0.0", {"platforms": [unittest.mock.sentinel.list_item]}, [unittest.mock.sentinel.list_item]), # ==

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.