Skip to content

Commit cd3f493

Browse files
committed
Fix error in tree model constructor
Fixes #92 Signed-off-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
1 parent 3ce6730 commit cd3f493

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tree_model.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ def __init__(self, entries, headers=None):
4242
elem = TreeItem(entry)
4343
id_map[entry.id] = elem
4444

45-
parent = id_map[entry.parent_id]
46-
# pylint: disable=consider-iterating-dictionary
47-
if entry.parent_id in id_map.keys() and elem not in parent.get_children():
48-
parent.add_child(elem)
49-
elem.set_parent(parent)
45+
if entry.parent_id in id_map.keys():
46+
parent = id_map[entry.parent_id]
47+
if elem not in parent.get_children():
48+
parent.add_child(elem)
49+
elem.set_parent(parent)
5050

5151
def print(self):
5252
"""Render this tree model."""

0 commit comments

Comments
 (0)