Skip to content

Commit 074f937

Browse files
committed
Avoid overriding json.load (fixes #37)
1 parent b6514dd commit 074f937

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jsonpatch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def multidict(ordered_pairs):
9898

9999
# The "object_pairs_hook" parameter is used to handle duplicate keys when
100100
# loading a JSON object.
101-
json.load = functools.partial(json.load, object_pairs_hook=multidict)
101+
_jsonloads = functools.partial(json.loads, object_pairs_hook=multidict)
102102

103103

104104
def apply_patch(doc, patch, in_place=False):
@@ -260,7 +260,7 @@ def from_string(cls, patch_str):
260260
261261
:return: :class:`JsonPatch` instance.
262262
"""
263-
patch = json.loads(patch_str)
263+
patch = _jsonloads(patch_str)
264264
return cls(patch)
265265

266266
@classmethod

0 commit comments

Comments
 (0)