Parcourir la source

wxGUI/treemodel: fix removing children of root (#775)

Anna Petrasova il y a 4 ans
Parent
commit
f0dea931f7
1 fichiers modifiés avec 1 ajouts et 2 suppressions
  1. 1 2
      gui/wxpython/core/treemodel.py

+ 1 - 2
gui/wxpython/core/treemodel.py

@@ -134,8 +134,7 @@ class TreeModel(object):
             node.parent.children.remove(node)
         else:
             # node is root
-            for n in node.children:
-                node.children.remove(n)
+            del node.children[:]
 
     def SortChildren(self, node):
         """Sorts children alphabetically based on label."""