diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2005-03-01 08:09:28 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2005-03-01 08:09:28 (GMT) |
commit | 4afe154369c1741bcdba1e7d715e0609082dea43 (patch) | |
tree | 88281d5b2af803db97a1a5608a103eb367d760e5 /Lib/lib-tk | |
parent | 5ce2587b1b9955687804b3636fe32536add55eb2 (diff) | |
download | cpython-4afe154369c1741bcdba1e7d715e0609082dea43.zip cpython-4afe154369c1741bcdba1e7d715e0609082dea43.tar.gz cpython-4afe154369c1741bcdba1e7d715e0609082dea43.tar.bz2 |
Patch #1121234: Properly cleanup _exit and tkerror commands.
Will backport to 2.4.
Diffstat (limited to 'Lib/lib-tk')
-rw-r--r-- | Lib/lib-tk/Tkinter.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index fa57e25..81bf465 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -1599,8 +1599,15 @@ class Tk(Misc, Wm): raise RuntimeError, \ "Tk 4.0 or higher is required; found Tk %s" \ % str(TkVersion) + # Create and register the tkerror and exit commands + # We need to inline parts of _register here, _ register + # would register differently-named commands. + if self._tclCommands is None: + self._tclCommands = [] self.tk.createcommand('tkerror', _tkerror) self.tk.createcommand('exit', _exit) + self._tclCommands.append('tkerror') + self._tclCommands.append('exit') if _support_default_root and not _default_root: _default_root = self self.protocol("WM_DELETE_WINDOW", self.destroy) |