]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Patch #1121234: Properly cleanup _exit and tkerror commands.
authorMartin v. Löwis <martin@v.loewis.de>
Tue, 1 Mar 2005 08:10:49 +0000 (08:10 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Tue, 1 Mar 2005 08:10:49 +0000 (08:10 +0000)
Lib/lib-tk/Tkinter.py
Misc/NEWS

index fa57e2587cc705f1e1db74bc6c0144e4a0710ecd..81bf465de1d1437adc962430ebc2715b0722e875 100644 (file)
@@ -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)
index 055c32b3770a091a00e104cb723ebf6624895e2b..08f9bedb508a04fb4f29a99cdd09c1e2d3c4f77f 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -35,6 +35,8 @@ Extension Modules
 Library
 -------
 
+- Patch #1121234: Properly cleanup _exit and tkerror commands.
+
 - Applied a security fix to SimpleXMLRPCserver (PSF-2005-001).  This
   disables recursive traversal through instance attributes, which can
   be exploited in various ways.