]> granicus.if.org Git - python/commitdiff
Merged revisions 78988 via svnmerge from
authorMatthias Klose <doko@ubuntu.com>
Tue, 16 Mar 2010 10:51:28 +0000 (10:51 +0000)
committerMatthias Klose <doko@ubuntu.com>
Tue, 16 Mar 2010 10:51:28 +0000 (10:51 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r78988 | matthias.klose | 2010-03-16 11:48:52 +0100 (Tue, 16 Mar 2010) | 3 lines

  - Issue #4961: Inconsistent/wrong result of askyesno function in tkMessageBox
    with Tcl/Tk-8.5.
........

Lib/tkinter/messagebox.py
Misc/NEWS

index c9349567f824a3335454f515c7ca1d90b65522fc..5c35d5adbaf85e0fe3bc3cbc83b0da19a994704b 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 1afc8323c79cda9e5309721b0048e5572774e516..84b2bb9748fafd160763e671660e68483511d03d 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -283,6 +283,9 @@ C-API
 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