Skip to content

Commit 7692bb7

Browse files
authored
Merge pull request #13 from Korijn/fix-list-append
Fix appending operation for list
2 parents 3e724b8 + 7dd40c1 commit 7692bb7

File tree

3 files changed

+96
-92
lines changed

3 files changed

+96
-92
lines changed

patchdiff/apply.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ def iapply(obj: Diffable, patches: List[Dict]) -> Diffable:
1919
else: # add/replace
2020
parent[key] = value
2121
elif hasattr(parent, "append"): # list
22-
key = int(key)
22+
try:
23+
key = int(key)
24+
except ValueError:
25+
pass
26+
2327
if op == "replace":
2428
parent[key] = value
2529
elif op == "add":

0 commit comments

Comments
 (0)