]> granicus.if.org Git - python/commitdiff
Patch #1594554: Always close a tkSimpleDialog on ok(), even
authorMartin v. Löwis <martin@v.loewis.de>
Sat, 18 Nov 2006 18:05:57 +0000 (18:05 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sat, 18 Nov 2006 18:05:57 +0000 (18:05 +0000)
if an exception occurs.

Lib/lib-tk/tkSimpleDialog.py
Misc/NEWS

index 02ea034b339290f1ddd84bc84124fa9bd659d0f7..445048440a9ed936bb741df6c4aff441628a82a7 100644 (file)
@@ -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):
 
index 6e50ed3c7b93303c7df34b65edec8fd098a8d370..5b9815535037163da82931bf94facdd854d89ede 100644 (file)
--- 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.