summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib
diff options
context:
space:
mode:
authorKurt B. Kaiser <kbk@shore.net>2007-10-25 22:43:45 (GMT)
committerKurt B. Kaiser <kbk@shore.net>2007-10-25 22:43:45 (GMT)
commitaa8a96a159afbbf52e0bbc84303540f1341447c0 (patch)
tree432562f3193666deffdb7a24aaaa2c6987d3b8e0 /Lib/idlelib
parent469b2a52cdeb861311d3dada9aadb75cfd652f23 (diff)
downloadcpython-aa8a96a159afbbf52e0bbc84303540f1341447c0.zip
cpython-aa8a96a159afbbf52e0bbc84303540f1341447c0.tar.gz
cpython-aa8a96a159afbbf52e0bbc84303540f1341447c0.tar.bz2
Correct an ancient bug in an unused path by removing that path: register() is
now idempotent.
Diffstat (limited to 'Lib/idlelib')
-rw-r--r--Lib/idlelib/WidgetRedirector.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/Lib/idlelib/WidgetRedirector.py b/Lib/idlelib/WidgetRedirector.py
index df60cea..f941cc2 100644
--- a/Lib/idlelib/WidgetRedirector.py
+++ b/Lib/idlelib/WidgetRedirector.py
@@ -29,13 +29,9 @@ class WidgetRedirector:
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):