[Python-3000-checkins] r56327 - in python/branches/p3yk/Lib: idlelib/WidgetRedirector.py lib-tk/Tkinter.py

kurt.kaiser python-3000-checkins at python.org
Thu Jul 12 21:20:21 CEST 2007


Author: kurt.kaiser
Date: Thu Jul 12 21:20:20 2007
New Revision: 56327

Modified:
   python/branches/p3yk/Lib/idlelib/WidgetRedirector.py
   python/branches/p3yk/Lib/lib-tk/Tkinter.py
Log:
Fix another instance of this defect in Tkinter, and one in IDLE.

Patch 1724999 by Ali Gholami Rudi -- avoid complaints about dict size
change during iter in destroy call.


Modified: python/branches/p3yk/Lib/idlelib/WidgetRedirector.py
==============================================================================
--- python/branches/p3yk/Lib/idlelib/WidgetRedirector.py	(original)
+++ python/branches/p3yk/Lib/idlelib/WidgetRedirector.py	Thu Jul 12 21:20:20 2007
@@ -19,7 +19,7 @@
                                              self.widget._w)
 
     def close(self):
-        for name in self.dict.keys():
+        for name in list(self.dict.keys()):
             self.unregister(name)
         widget = self.widget; del self.widget
         orig = self.orig; del self.orig

Modified: python/branches/p3yk/Lib/lib-tk/Tkinter.py
==============================================================================
--- python/branches/p3yk/Lib/lib-tk/Tkinter.py	(original)
+++ python/branches/p3yk/Lib/lib-tk/Tkinter.py	Thu Jul 12 21:20:20 2007
@@ -1680,7 +1680,7 @@
     def destroy(self):
         """Destroy this and all descendants widgets. This will
         end the application of this Tcl interpreter."""
-        for c in self.children.values(): c.destroy()
+        for c in list(self.children.values()): c.destroy()
         self.tk.call('destroy', self._w)
         Misc.destroy(self)
         global _default_root


More information about the Python-3000-checkins mailing list