diff options
author | QMK Bot <hello@qmk.fm> | 2020-12-19 18:47:05 +0000 |
---|---|---|
committer | QMK Bot <hello@qmk.fm> | 2020-12-19 18:47:05 +0000 |
commit | 32f53c0671be04fa651eac89ec59b7518a9d3b5e (patch) | |
tree | 3bdb94ffd1837481edd2d89cbaedf1cdd0312be8 /lib/python/qmk/info.py | |
parent | d11116f734e7fc93eda6480261e10de6d85975d6 (diff) | |
parent | 624cafbfd2199fdf9fb0e834d7e9f1df70221336 (diff) |
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'lib/python/qmk/info.py')
-rw-r--r-- | lib/python/qmk/info.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py index d73ba8cfb6..f476dc666d 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py @@ -230,11 +230,15 @@ def merge_info_jsons(keyboard, info_data): """ for info_file in find_info_json(keyboard): # Load and validate the JSON data - with info_file.open('r') as info_fd: - new_info_data = json.load(info_fd) + try: + with info_file.open('r') as info_fd: + new_info_data = json.load(info_fd) + except Exception as e: + _log_error(info_data, "Invalid JSON in file %s: %s: %s" % (str(info_file), e.__class__.__name__, e)) + continue if not isinstance(new_info_data, dict): - _log_error(info_data, "Invalid file %s, root object should be a dictionary.", str(info_file)) + _log_error(info_data, "Invalid file %s, root object should be a dictionary." % (str(info_file),)) continue # Copy whitelisted keys into `info_data` |