From: Martin v. Löwis Date: Sat, 18 Nov 2006 18:05:35 +0000 (+0000) Subject: Patch #1594554: Always close a tkSimpleDialog on ok(), even X-Git-Tag: v2.6a1~2425 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ef5fd3e7c991feb1a712e4b791d5a2552ae09f81;p=thirdparty%2FPython%2Fcpython.git Patch #1594554: Always close a tkSimpleDialog on ok(), even if an exception occurs. Will backport to 2.5. --- diff --git a/Lib/lib-tk/tkSimpleDialog.py b/Lib/lib-tk/tkSimpleDialog.py index 02ea034b3392..445048440a9e 100644 --- a/Lib/lib-tk/tkSimpleDialog.py +++ b/Lib/lib-tk/tkSimpleDialog.py @@ -129,9 +129,10 @@ class Dialog(Toplevel): self.withdraw() self.update_idletasks() - self.apply() - - self.cancel() + try: + self.apply() + finally: + self.cancel() def cancel(self, event=None): diff --git a/Misc/NEWS b/Misc/NEWS index 42f0b93b7fa5..b1cf907228a5 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -98,6 +98,9 @@ Core and builtins Library ------- +- Patch #1594554: Always close a tkSimpleDialog on ok(), even + if an exception occurs. + - Patch #1538878: Don't make tkSimpleDialog dialogs transient if the parent window is withdrawn.