summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Hilliard <jonathan.hilliard@hpe.com>2020-01-28 10:56:41 -0600
committerJonathan Hilliard <jonathan.hilliard@hpe.com>2020-01-28 10:56:41 -0600
commit97e18f38e03961c8984969214bdc082c2a4560e4 (patch)
treed1640bbb41dfbcb09d2395ed07a98609d3fd980c
parent028089d7e74f049a78bfea638c5b069491011e3f (diff)
downloadpython-json-patch-97e18f38e03961c8984969214bdc082c2a4560e4.tar.gz
Changing previous type comparison to just comparing how json.dumps renders 2 values.
This avoids flagging mismatches between classes which happen to be different but which are JSONified as the same thing.
-rw-r--r--jsonpatch.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/jsonpatch.py b/jsonpatch.py
index a72fcea..5454f56 100644
--- a/jsonpatch.py
+++ b/jsonpatch.py
@@ -825,7 +825,7 @@ class DiffBuilder(object):
isinstance(dst, MutableSequence):
self._compare_lists(_path_join(path, key), src, dst)
- elif src == dst and type(src) == type(dst):
+ elif json.dumps(src) == json.dumps(dst):
return
else: