Skip to content

Commit

Permalink
merge lists without duplicates in merge_data
Browse files Browse the repository at this point in the history
  • Loading branch information
vpoughonEZ authored and danwos committed May 4, 2023
1 parent 571bdd3 commit c27057e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sphinx_needs/needs.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,11 +739,11 @@ def merge(name: str, is_complex_dict: bool = False) -> None:
for other_key, other_value in other_objects.items():
# other_value is a list from here on!
if other_key in objects:
objects[other_key] += other_value
objects[other_key] = list(set(objects[other_key]) | set(other_value))
else:
objects[other_key] = other_value
elif isinstance(other_objects, list) and isinstance(objects, list):
objects += other_objects
objects = list(set(objects) | set(other_objects))
else:
raise TypeError(
f'Objects to "merge" must be dict or list, ' f"not {type(other_objects)} and {type(objects)}"
Expand Down

0 comments on commit c27057e

Please sign in to comment.