瀏覽代碼

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

Anna Petrasova 4 年之前
父節點
當前提交
f0dea931f7
共有 1 個文件被更改,包括 1 次插入2 次删除
  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."""