Fix compatibility with Python 3.x
This commit is contained in:
@@ -449,8 +449,13 @@ class TestOperation(PatchOperation):
|
|||||||
def apply(self, obj):
|
def apply(self, obj):
|
||||||
try:
|
try:
|
||||||
subobj, part = self.locate(obj, self.location)
|
subobj, part = self.locate(obj, self.location)
|
||||||
except JsonPatchConflict, c:
|
except JsonPatchConflict:
|
||||||
raise JsonPatchTestFailed(str(c))
|
exc_info = sys.exc_info()
|
||||||
|
exc = JsonPatchTestFailed(str(exc_info[1]))
|
||||||
|
if sys.version_info >= (3, 0):
|
||||||
|
raise exc.with_traceback(exc_info[2])
|
||||||
|
else:
|
||||||
|
raise exc
|
||||||
|
|
||||||
val = subobj[part]
|
val = subobj[part]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user