From b0c670ce398e7f8953b9a13ae0e40de6ef70d05f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Sat, 18 Sep 2004 16:01:23 +0000 Subject: Convert boolean results back to strings. Fixes #807871. Will backport to 2.3. --- Lib/lib-tk/tkMessageBox.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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" -- cgit v0.12