[Python-checkins] cpython (3.2): Issue #5219: Prevent event handler cascade in IDLE.

martin.v.loewis python-checkins at python.org
Tue Mar 13 22:34:13 CET 2012


http://hg.python.org/cpython/rev/7e79dbceb039
changeset:   75601:7e79dbceb039
branch:      3.2
parent:      75596:246e681a4272
user:        Martin v. Löwis <martin at v.loewis.de>
date:        Tue Mar 13 14:32:29 2012 -0700
summary:
  Issue #5219: Prevent event handler cascade in IDLE.
Patch by Roger Serwy.

files:
  Lib/idlelib/CallTipWindow.py |  6 +++++-
  Misc/NEWS                    |  2 ++
  2 files changed, 7 insertions(+), 1 deletions(-)


diff --git a/Lib/idlelib/CallTipWindow.py b/Lib/idlelib/CallTipWindow.py
--- a/Lib/idlelib/CallTipWindow.py
+++ b/Lib/idlelib/CallTipWindow.py
@@ -22,6 +22,7 @@
         self.parenline = self.parencol = None
         self.lastline = None
         self.hideid = self.checkhideid = None
+        self.checkhide_after_id = None
 
     def position_window(self):
         """Check if needs to reposition the window, and if so - do it."""
@@ -102,7 +103,10 @@
             self.hidetip()
         else:
             self.position_window()
-            self.widget.after(CHECKHIDE_TIME, self.checkhide_event)
+            if self.checkhide_after_id is not None:
+                self.widget.after_cancel(self.checkhide_after_id)
+            self.checkhide_after_id = \
+                self.widget.after(CHECKHIDE_TIME, self.checkhide_event)
 
     def hide_event(self, event):
         if not self.tipwindow:
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -22,6 +22,8 @@
 Library
 -------
 
+- Issue #5219: Prevent event handler cascade in IDLE.
+
 - Issue #14184: Increase the default stack size for secondary threads on
   Mac OS X to avoid interpreter crashes when using threads on 10.7.
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list