replace json.loads with direct calls to JSONDecoder.decode
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user