summaryrefslogtreecommitdiffstats
path: root/Lib/lib-tk/tkMessageBox.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2004-09-18 16:01:23 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2004-09-18 16:01:23 (GMT)
commitb0c670ce398e7f8953b9a13ae0e40de6ef70d05f (patch)
tree29c6653f406d26fada534a88a3ed6a35453bebd1 /Lib/lib-tk/tkMessageBox.py
parent5d52e781d9c2b11ce5a1296a1f9e10e3fac99b54 (diff)
downloadcpython-b0c670ce398e7f8953b9a13ae0e40de6ef70d05f.zip
cpython-b0c670ce398e7f8953b9a13ae0e40de6ef70d05f.tar.gz
cpython-b0c670ce398e7f8953b9a13ae0e40de6ef70d05f.tar.bz2
Convert boolean results back to strings. Fixes #807871.
Will backport to 2.3.
Diffstat (limited to 'Lib/lib-tk/tkMessageBox.py')
-rw-r--r--Lib/lib-tk/tkMessageBox.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/lib-tk/tkMessageBox.py b/Lib/lib-tk/tkMessageBox.py
index c2aa928..8c94677 100644
--- a/Lib/lib-tk/tkMessageBox.py
+++ b/Lib/lib-tk/tkMessageBox.py
@@ -72,7 +72,12 @@ def _show(title=None, message=None, icon=None, type=None, **options):
if type: options["type"] = type
if title: options["title"] = title
if message: options["message"] = message
- return Message(**options).show()
+ res = Message(**options).show()
+ # In some Tcl installations, Tcl converts yes/no into a boolean
+ if isinstance(res, bool):
+ if res: return YES
+ return NO
+ return res
def showinfo(title=None, message=None, **options):
"Show an info message"