[Python-checkins] r58656 - python/trunk/Lib/idlelib/WidgetRedirector.py

kurt.kaiser python-checkins at python.org
Fri Oct 26 00:43:45 CEST 2007


Author: kurt.kaiser
Date: Fri Oct 26 00:43:45 2007
New Revision: 58656

Modified:
   python/trunk/Lib/idlelib/WidgetRedirector.py
Log:
Correct an ancient bug in an unused path by removing that path: register() is
now idempotent.


Modified: python/trunk/Lib/idlelib/WidgetRedirector.py
==============================================================================
--- python/trunk/Lib/idlelib/WidgetRedirector.py	(original)
+++ python/trunk/Lib/idlelib/WidgetRedirector.py	Fri Oct 26 00:43:45 2007
@@ -29,13 +29,9 @@
         tk.call("rename", orig, w)
 
     def register(self, name, function):
-        if self.dict.has_key(name):
-            previous = dict[name]
-        else:
-            previous = OriginalCommand(self, name)
         self.dict[name] = function
         setattr(self.widget, name, function)
-        return previous
+        return OriginalCommand(self, name)
 
     def unregister(self, name):
         if self.dict.has_key(name):


More information about the Python-checkins mailing list