diff options
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 d73ba8cfb..f476dc666 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py | |||
@@ -230,11 +230,15 @@ def merge_info_jsons(keyboard, info_data): | |||
230 | """ | 230 | """ |
231 | for info_file in find_info_json(keyboard): | 231 | for info_file in find_info_json(keyboard): |
232 | # Load and validate the JSON data | 232 | # Load and validate the JSON data |
233 | with info_file.open('r') as info_fd: | 233 | try: |
234 | new_info_data = json.load(info_fd) | 234 | with info_file.open('r') as info_fd: |
235 | new_info_data = json.load(info_fd) | ||
236 | except Exception as e: | ||
237 | _log_error(info_data, "Invalid JSON in file %s: %s: %s" % (str(info_file), e.__class__.__name__, e)) | ||
238 | continue | ||
235 | 239 | ||
236 | if not isinstance(new_info_data, dict): | 240 | if not isinstance(new_info_data, dict): |
237 | _log_error(info_data, "Invalid file %s, root object should be a dictionary.", str(info_file)) | 241 | _log_error(info_data, "Invalid file %s, root object should be a dictionary." % (str(info_file),)) |
238 | continue | 242 | continue |
239 | 243 | ||
240 | # Copy whitelisted keys into `info_data` | 244 | # Copy whitelisted keys into `info_data` |