summaryrefslogtreecommitdiff
path: root/jsonpatch.py
diff options
context:
space:
mode:
Diffstat (limited to 'jsonpatch.py')
-rw-r--r--jsonpatch.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/jsonpatch.py b/jsonpatch.py
index 0eb3e55..a521bd0 100644
--- a/jsonpatch.py
+++ b/jsonpatch.py
@@ -352,8 +352,13 @@ class RemoveOperation(PatchOperation):
subobj, part = self.pointer.to_last(obj)
try:
del subobj[part]
- except KeyError as ex:
- raise JsonPatchConflict(ex)
+ except KeyError:
+ exc_info = sys.exc_info()
+ exc = JsonPatchConflict(str(exc_info[1]))
+ if sys.version_info >= (3, 0):
+ raise exc.with_traceback(exc_info[2])
+ else:
+ raise exc
class AddOperation(PatchOperation):