Skip to content

Commit

Permalink
Fix ros2#762
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Ruf <[email protected]>
  • Loading branch information
baconbrot committed Mar 4, 2024
1 parent d9ffd80 commit b9fb94f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion launch_yaml/launch_yaml/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,15 @@ def get_attr(
data = self.__element[name]
if check_is_list_entity(data_type):
if isinstance(data, list) and isinstance(data[0], dict):
return [Entity(child, name) for child in data]
entities = []
for child in data:
if len(child) != 1:
raise RuntimeError(
'Subentities must be a dictionary with only one key'
', which is the entity type')
type_name = list(child.keys())[0]
entities.append(Entity(child[type_name], type_name))
return entities
raise TypeError(
"Attribute '{}' of Entity '{}' expected to be a list of dictionaries.".format(
name, self.type_name
Expand Down

0 comments on commit b9fb94f

Please sign in to comment.