diff options
author | Stefan Kögl <stefan@skoegl.net> | 2017-10-21 11:19:35 +0200 |
---|---|---|
committer | Stefan Kögl <stefan@skoegl.net> | 2017-10-21 11:19:35 +0200 |
commit | 074f937de30079dfec69733cc5fe4cd459faee2f (patch) | |
tree | 7e61835c9753e1bb5e494571ba3a9e51f82cc876 | |
parent | b6514dd9551d453f2ee8485283d538e00f5015be (diff) | |
download | python-json-patch-074f937de30079dfec69733cc5fe4cd459faee2f.tar.gz |
Avoid overriding json.load (fixes #37)jsonload-no-override
-rw-r--r-- | jsonpatch.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/jsonpatch.py b/jsonpatch.py index e1a5b2d..41c14a4 100644 --- a/jsonpatch.py +++ b/jsonpatch.py @@ -98,7 +98,7 @@ def multidict(ordered_pairs): # The "object_pairs_hook" parameter is used to handle duplicate keys when # loading a JSON object. -json.load = functools.partial(json.load, object_pairs_hook=multidict) +_jsonloads = functools.partial(json.loads, object_pairs_hook=multidict) def apply_patch(doc, patch, in_place=False): @@ -260,7 +260,7 @@ class JsonPatch(object): :return: :class:`JsonPatch` instance. """ - patch = json.loads(patch_str) + patch = _jsonloads(patch_str) return cls(patch) @classmethod |