StringTree: Fix exception in child_list()

child_list() throws an exception saying that <str> has no to_list()
method. No, it hasn't. No idea how this has even worked at all, ever.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2024-10-06 17:04:25 +02:00
commit 08045442e2

View file

@ -184,9 +184,10 @@ class StringTree: # export
if depth_first == False: if depth_first == False:
raise Exception("tried to retrieve child list with breadth-first search, not yet implemented") raise Exception("tried to retrieve child list with breadth-first search, not yet implemented")
r = [] r = []
for c in self.children: for name, c in self.children.items():
r.append(c) r.append(c)
r.extend(c.to_list()) r.extend(c.child_list())
return r
def dump(self, prio: int, *args, **kwargs) -> None: def dump(self, prio: int, *args, **kwargs) -> None:
caller = kwargs['caller'] if 'caller' in kwargs.keys() else get_caller_pos(1) caller = kwargs['caller'] if 'caller' in kwargs.keys() else get_caller_pos(1)