Merge lists, not overwrite
This commit is contained in:
@@ -34,6 +34,8 @@ def mergeDicts(a, b):
|
|||||||
else:
|
else:
|
||||||
if isDict(current_src[key]) and isDict(current_dst[key]):
|
if isDict(current_src[key]) and isDict(current_dst[key]):
|
||||||
stack.append((current_dst[key], current_src[key]))
|
stack.append((current_dst[key], current_src[key]))
|
||||||
|
elif isinstance(current_src[key], list) and isinstance(current_dst[key], list):
|
||||||
|
current_dst[key].extend(current_src[key])
|
||||||
else:
|
else:
|
||||||
current_dst[key] = current_src[key]
|
current_dst[key] = current_src[key]
|
||||||
return dst
|
return dst
|
||||||
|
|||||||
Reference in New Issue
Block a user