From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:14:45 +0000 (+0100) Subject: [3.11] gh-112898: warn about unsaved files when quitting IDLE on macOS (GH-112939... X-Git-Tag: v3.11.8~287 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a37e1473da30cf24b3df2cc3d8c02ab8bc05d44a;p=thirdparty%2FPython%2Fcpython.git [3.11] gh-112898: warn about unsaved files when quitting IDLE on macOS (GH-112939) (#112961) gh-112898: warn about unsaved files when quitting IDLE on macOS (GH-112939) * gh-112898: warn about unsaved files when quitting IDLE on macOS Implement the TK function ``::tk::mac::Quit`` on macOS to ensure that IDLE asks about saving unsaved files when quitting IDLE. (cherry picked from commit 3251ba8f1af535bf28e31a6832511ba19e96b262) Co-authored-by: Christopher Chavez chrischavez@gmx.us Co-authored-by: Ronald Oussoren --- diff --git a/Lib/idlelib/macosx.py b/Lib/idlelib/macosx.py index 89b645702d33..086bfa365129 100644 --- a/Lib/idlelib/macosx.py +++ b/Lib/idlelib/macosx.py @@ -222,7 +222,7 @@ def overrideRootMenu(root, flist): # The binding above doesn't reliably work on all versions of Tk # on macOS. Adding command definition below does seem to do the # right thing for now. - root.createcommand('exit', flist.close_all_callback) + root.createcommand('::tk::mac::Quit', flist.close_all_callback) if isCarbonTk(): # for Carbon AquaTk, replace the default Tk apple menu diff --git a/Misc/NEWS.d/next/IDLE/2023-12-10-20-01-11.gh-issue-112898.98aWv2.rst b/Misc/NEWS.d/next/IDLE/2023-12-10-20-01-11.gh-issue-112898.98aWv2.rst new file mode 100644 index 000000000000..1c20e46b1e5f --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2023-12-10-20-01-11.gh-issue-112898.98aWv2.rst @@ -0,0 +1 @@ +Fix processing unsaved files when quitting IDLE on macOS.