From: Martin v. Löwis Date: Sat, 18 Nov 2006 18:05:57 +0000 (+0000) Subject: Patch #1594554: Always close a tkSimpleDialog on ok(), even X-Git-Tag: v2.5.1c1~246 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e350c840b389f645b25f00f1fa35f6ea1fec03b3;p=python Patch #1594554: Always close a tkSimpleDialog on ok(), even if an exception occurs. --- diff --git a/Lib/lib-tk/tkSimpleDialog.py b/Lib/lib-tk/tkSimpleDialog.py index 02ea034b33..445048440a 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 6e50ed3c7b..5b98155350 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -103,6 +103,9 @@ Extension Modules 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.