We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d9adf1 commit b878d85Copy full SHA for b878d85
jsonpatch.py
@@ -175,7 +175,11 @@ def make_patch(src, dst):
175
# TODO: fix patch optimiztion and remove the following check
176
# fix when patch with optimization is incorrect
177
patch = JsonPatch.from_diff(src, dst)
178
- new = patch.apply(src)
+ try:
179
+ new = patch.apply(src)
180
+ except JsonPatchConflict: # see TODO
181
+ return JsonPatch.from_diff(src, dst, False)
182
+
183
if new != dst:
184
return JsonPatch.from_diff(src, dst, False)
185
@@ -601,7 +605,6 @@ def _longest_common_subseq(src, dst):
601
605
matrix[i][j] = matrix[i-1][j-1] + 1
602
606
if matrix[i][j] > z:
603
607
z = matrix[i][j]
604
- if matrix[i][j] == z:
608
range_src = (i-z+1, i+1)
609
range_dst = (j-z+1, j+1)
610
else:
0 commit comments