Skip to content

Commit

Permalink
Merge pull request #13 from Korijn/fix-list-append
Browse files Browse the repository at this point in the history
Fix appending operation for list
  • Loading branch information
Korijn committed Nov 15, 2021
2 parents 3e724b8 + 7dd40c1 commit 7692bb7
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 92 deletions.
6 changes: 5 additions & 1 deletion patchdiff/apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ def iapply(obj: Diffable, patches: List[Dict]) -> Diffable:
else: # add/replace
parent[key] = value
elif hasattr(parent, "append"): # list
key = int(key)
try:
key = int(key)
except ValueError:
pass

if op == "replace":
parent[key] = value
elif op == "add":
Expand Down
Loading

0 comments on commit 7692bb7

Please sign in to comment.