mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
Don't handle merging lists
Doesn't work clearly
This commit is contained in:
@@ -106,7 +106,7 @@ def _merge_dictionaries(a, b, path=None, update=True):
|
||||
"""
|
||||
Merge two dictionaries recursively.
|
||||
|
||||
From https://stackoverflow.com/a/25270947
|
||||
From https://stackoverflow.com/a/7205107
|
||||
"""
|
||||
if path is None:
|
||||
path = []
|
||||
@@ -116,14 +116,6 @@ def _merge_dictionaries(a, b, path=None, update=True):
|
||||
_merge_dictionaries(a[key], b[key], path + [str(key)])
|
||||
elif a[key] == b[key]:
|
||||
pass # same leaf value
|
||||
elif isinstance(a[key], list) and isinstance(b[key], list):
|
||||
for idx, val in enumerate(b[key]):
|
||||
a[key][idx] = _merge_dictionaries(
|
||||
a[key][idx],
|
||||
b[key][idx],
|
||||
path + [str(key), str(idx)],
|
||||
update=update
|
||||
)
|
||||
elif update:
|
||||
a[key] = b[key]
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user