]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
- Issue #4961: Inconsistent/wrong result of askyesno function in tkMessageBox
authorMatthias Klose <doko@ubuntu.com>
Tue, 16 Mar 2010 10:48:52 +0000 (10:48 +0000)
committerMatthias Klose <doko@ubuntu.com>
Tue, 16 Mar 2010 10:48:52 +0000 (10:48 +0000)
  with Tcl/Tk-8.5.

Lib/lib-tk/tkMessageBox.py
Misc/NEWS

index d14ca86febc0bf592d5d3a9a18fc96b7efa50a5a..9ee923576ffe6c42ca4ea6d75cb10c1239992350 100644 (file)
@@ -70,11 +70,13 @@ def _show(title=None, message=None, _icon=None, _type=None, **options):
     if title:   options["title"] = title
     if message: options["message"] = message
     res = Message(**options).show()
-    # In some Tcl installations, Tcl converts yes/no into a boolean
+    # In some Tcl installations, yes/no is converted into a boolean.
     if isinstance(res, bool):
-        if res: return YES
+        if res:
+            return YES
         return NO
-    return res
+    # In others we get a Tcl_Obj.
+    return str(res)
 
 def showinfo(title=None, message=None, **options):
     "Show an info message"
index a6fe33ac74c7f50525b14bcf9533973e6c61d664..35fddebf933d93461090401aeeca9d65ba3079fc 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -20,6 +20,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #4961: Inconsistent/wrong result of askyesno function in tkMessageBox
+  with Tcl/Tk-8.5.
+
 - Issue #8140: extend compileall to compile single files. Add -i option.
 
 - Issue #7356: ctypes.util: Make parsing of ldconfig output independent of