Skip to content

Commit

Permalink
Use pyjson5 instead of json5
Browse files Browse the repository at this point in the history
  • Loading branch information
multiplemonomials committed Sep 13, 2024
1 parent 8135816 commit 9290323
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@
"""

import pathlib
import datetime
import sys

from junitparser import JUnitXml
import cmsis_pack_manager
import json5

from test_result_evaluator import mbed_test_database

if len(sys.argv) != 3:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@

from mbed_tools.targets._internal.target_attributes import get_target_attributes

import json5
import cmsis_pack_manager
import pyjson5


class TestResult(enum.IntEnum):
Expand Down Expand Up @@ -183,13 +182,13 @@ def populate_targets_and_drivers(self, mbed_os_path: pathlib.Path):
"""

target_json5_file = mbed_os_path / "targets" / "targets.json5"
targets_data: Dict[str, Any] = json5.loads(target_json5_file.read_text())
targets_data: Dict[str, Any] = pyjson5.decode(target_json5_file.read_text())

drivers_json5_file = mbed_os_path / "targets" / "drivers.json5"
drivers_data: Dict[str, Any] = json5.loads(drivers_json5_file.read_text())
drivers_data: Dict[str, Any] = pyjson5.decode(drivers_json5_file.read_text())

cmsis_mcu_descriptions_json5_file = mbed_os_path / "targets" / "cmsis_mcu_descriptions.json5"
cmsis_mcu_description_data: Dict[str, Any] = json5.loads(cmsis_mcu_descriptions_json5_file.read_text())
cmsis_mcu_description_data: Dict[str, Any] = pyjson5.decode(cmsis_mcu_descriptions_json5_file.read_text())

# First assemble a list of all the drivers.
# For this we want to process the JSON directly rather than dealing with target inheritance, because
Expand Down

0 comments on commit 9290323

Please sign in to comment.