From 7392340e535801ff54fe3ff71b0b519b06b4fb74 Mon Sep 17 00:00:00 2001 From: Samuel Gaist <samuel.gaist@idiap.ch> Date: Wed, 20 Mar 2019 11:54:33 +0100 Subject: [PATCH] [hash] Import simplejson as json to make it easy to swap --- beat/core/hash.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/beat/core/hash.py b/beat/core/hash.py index 751c010a..5ecdd531 100644 --- a/beat/core/hash.py +++ b/beat/core/hash.py @@ -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) -- GitLab