Mailing List Archive

CVS: python/dist/src/Lib/lib-tk Tkinter.py,1.160,1.161
Update of /cvsroot/python/python/dist/src/Lib/lib-tk
In directory usw-pr-cvs1:/tmp/cvs-serv31087

Modified Files:
Tkinter.py
Log Message:
Ignore widgets with unknown names in winfo_children. Fixes #518283.
2.2.2 candidate.


Index: Tkinter.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/Tkinter.py,v
retrieving revision 1.160
retrieving revision 1.161
diff -C2 -d -r1.160 -r1.161
*** Tkinter.py 13 Oct 2001 09:33:51 -0000 1.160
--- Tkinter.py 27 Mar 2002 17:15:57 -0000 1.161
***************
*** 606,612 ****
def winfo_children(self):
"""Return a list of all widgets which are children of this widget."""
! return map(self._nametowidget,
! self.tk.splitlist(self.tk.call(
! 'winfo', 'children', self._w)))
def winfo_class(self):
"""Return window class name of this widget."""
--- 606,620 ----
def winfo_children(self):
"""Return a list of all widgets which are children of this widget."""
! result = []
! for child in self.tk.splitlist(
! self.tk.call('winfo', 'children', self._w)):
! try:
! # Tcl sometimes returns extra windows, e.g. for
! # menus; those need to be skipped
! result.append(self._nametowidget(child))
! except KeyError:
! pass
! return result
!
def winfo_class(self):
"""Return window class name of this widget."""