Commit 7392340e authored by Samuel GAIST's avatar Samuel GAIST

[hash] Import simplejson as json to make it easy to swap

parent 8a28d08f
......@@ -46,7 +46,7 @@ Also forward importing from :py:mod:`beat.backend.python.hash`
import collections
import simplejson
import simplejson as json
from beat.backend.python.hash import * # noqa
from beat.backend.python.hash import _sha256 # noqa
......@@ -165,9 +165,8 @@ def hashJSONStr(contents, description):
try:
return hashJSON( # noqa
simplejson.loads(contents, object_pairs_hook=collections.OrderedDict),
description,
json.loads(contents, object_pairs_hook=collections.OrderedDict), description
) # preserve order
except simplejson.JSONDecodeError:
except json.JSONDecodeError:
# falls back to normal file content hashing
return hash(contents)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment