Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2498972

Browse files
committed
Use self.__class__ to instantiate a TreeNode item recursively, to
allow subclassing.
1 parent 5d2af63 commit 2498972

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Tools/idle/TreeWidget.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def draw(self, x, y):
187187
# _IsExpandable() was mistaken; that's allowed
188188
return y+17
189189
for item in sublist:
190-
child = TreeNode(self.canvas, self, item)
190+
child = self.__class__(self.canvas, self, item)
191191
self.children.append(child)
192192
cx = x+20
193193
cy = y+17

0 commit comments

Comments
 (0)