mirror of https://github.com/python/cpython
Tim Peters writes:
[W]hile trying to dope out how redirection works, stumbled into two possible glitches. In the first, it doesn't appear to make sense to try to rename a command that's already been destroyed; in the second, the name "previous" doesn't really bring to mind "ignore the previous value" <wink>.
This commit is contained in:
parent
b46413f274
commit
2d6a568a0f
|
@ -28,11 +28,11 @@ class WidgetRedirector:
|
|||
tk = widget.tk
|
||||
w = widget._w
|
||||
tk.deletecommand(w)
|
||||
tk.call("rename", w, orig)
|
||||
tk.call("rename", orig, w)
|
||||
|
||||
def register(self, name, function):
|
||||
if self.dict.has_key(name):
|
||||
previous = function
|
||||
previous = dict[name]
|
||||
else:
|
||||
previous = OriginalCommand(self, name)
|
||||
self.dict[name] = function
|
||||
|
|
Loading…
Reference in New Issue