From: Martin v. Löwis Date: Tue, 1 Mar 2005 08:09:28 +0000 (+0000) Subject: Patch #1121234: Properly cleanup _exit and tkerror commands. X-Git-Tag: v2.5a0~1989 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4afe154369c1741bcdba1e7d715e0609082dea43;p=thirdparty%2FPython%2Fcpython.git Patch #1121234: Properly cleanup _exit and tkerror commands. Will backport to 2.4. --- diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index fa57e2587cc7..81bf465de1d1 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) diff --git a/Misc/NEWS b/Misc/NEWS index 4add264fb9c3..42ef277c3d37 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -59,6 +59,8 @@ Extension Modules Library ------- +- Patch #1121234: Properly cleanup _exit and tkerror commands. + - Patch #1049151: xdrlib now unpacks booleans as True or False. - Fixed bug in a NameError bug in cookielib. Patch #1116583.