Convert boolean results back to strings. Fixes #807871.
Will backport to 2.3.
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 @@
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"