[Python-checkins] python/dist/src/Lib/lib-tk Tkinter.py, 1.181, 1.182

loewis at users.sourceforge.net loewis at users.sourceforge.net
Tue Mar 1 09:10:01 CET 2005


Update of /cvsroot/python/python/dist/src/Lib/lib-tk
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv496/Lib/lib-tk

Modified Files:
	Tkinter.py 
Log Message:
Patch #1121234: Properly cleanup _exit and tkerror commands.
Will backport to 2.4.


Index: Tkinter.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/Tkinter.py,v
retrieving revision 1.181
retrieving revision 1.182
diff -u -d -r1.181 -r1.182
--- Tkinter.py	3 Aug 2004 18:36:25 -0000	1.181
+++ Tkinter.py	1 Mar 2005 08:09:27 -0000	1.182
@@ -1599,8 +1599,15 @@
             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)



More information about the Python-checkins mailing list