diff --git a/Lib/tkinter/messagebox.py b/Lib/tkinter/messagebox.py index c9349567f82..5c35d5adbaf 100644 --- a/Lib/tkinter/messagebox.py +++ b/Lib/tkinter/messagebox.py @@ -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" diff --git a/Misc/NEWS b/Misc/NEWS index 29aae7993ef..4103a257df2 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -17,6 +17,9 @@ Core and Builtins Library ------- +- Issue #4961: Inconsistent/wrong result of askyesno function in tkMessageBox + with Tcl/Tk-8.5. + - Issue #7356: ctypes.util: Make parsing of ldconfig output independent of the locale.