Skip to content

Commit db94e23

Browse files
committed
Add meaningful exception
1 parent 3572db5 commit db94e23

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

dpath/util.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,9 @@ def are_both_mutable(o1, o2):
286286
return False
287287

288288
def merger(dst, src, _segments=()):
289+
if not isinstance(dst, dict) or not isinstance(src, dict):
290+
raise ValueError("Merger function supports dict-like objects only")
291+
289292
for key, found in dpath.segments.kvs(src):
290293
# Our current path in the source.
291294
segments = _segments + (key,)

0 commit comments

Comments
 (0)