summaryrefslogtreecommitdiffstats
path: root/Lib/lib-tk
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-11-18 18:05:35 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2006-11-18 18:05:35 (GMT)
commitef5fd3e7c991feb1a712e4b791d5a2552ae09f81 (patch)
tree7c8ab63afb243b35847cb996518f1d97fab80367 /Lib/lib-tk
parentc73a4a4f5170c6f9631d8f07979af8a953507933 (diff)
downloadcpython-ef5fd3e7c991feb1a712e4b791d5a2552ae09f81.zip
cpython-ef5fd3e7c991feb1a712e4b791d5a2552ae09f81.tar.gz
cpython-ef5fd3e7c991feb1a712e4b791d5a2552ae09f81.tar.bz2
Patch #1594554: Always close a tkSimpleDialog on ok(), even
if an exception occurs. Will backport to 2.5.
Diffstat (limited to 'Lib/lib-tk')
-rw-r--r--Lib/lib-tk/tkSimpleDialog.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/lib-tk/tkSimpleDialog.py b/Lib/lib-tk/tkSimpleDialog.py
index 02ea034..4450484 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):