replace json.loads with direct calls to JSONDecoder.decode

This commit is contained in:
Mike Fährmann
2023-02-07 23:14:53 +01:00
parent b7337d810e
commit dd884b02ee
42 changed files with 117 additions and 154 deletions

View File

@@ -204,6 +204,9 @@ def datetime_to_timestamp_string(dt):
return ""
json_loads = json._default_decoder.decode
def dump_json(obj, fp=sys.stdout, ensure_ascii=True, indent=4):
"""Serialize 'obj' as JSON and write it to 'fp'"""
json.dump(
@@ -513,7 +516,7 @@ def parse_inputfile(file, log):
continue
try:
value = json.loads(value.strip())
value = json_loads(value.strip())
except ValueError as exc:
log.warning("input file: unable to parse '%s': %s", value, exc)
continue