]> granicus.if.org Git - python/commitdiff
Convert boolean results back to strings. Fixes #807871.
authorMartin v. Löwis <martin@v.loewis.de>
Sat, 18 Sep 2004 16:01:23 +0000 (16:01 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sat, 18 Sep 2004 16:01:23 +0000 (16:01 +0000)
Will backport to 2.3.

Lib/lib-tk/tkMessageBox.py

index c2aa9282a7d15ba89b809c921365cb940e44ddfd..8c94677a0772f9cd8cba23bb6d1574f419ba1a05 100644 (file)
@@ -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"