Skip to content

Commit b7e98cd

Browse files
ronaldoussorenGlyphack
authored andcommitted
pythongh-112898: warn about unsaved files when quitting IDLE on macOS (python#112939)
* pythongh-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. Co-authored-by: Christopher Chavez [email protected]
1 parent 155a657 commit b7e98cd

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Lib/idlelib/macosx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def help_dialog(event=None):
221221
# The binding above doesn't reliably work on all versions of Tk
222222
# on macOS. Adding command definition below does seem to do the
223223
# right thing for now.
224-
root.createcommand('exit', flist.close_all_callback)
224+
root.createcommand('::tk::mac::Quit', flist.close_all_callback)
225225

226226
if isCarbonTk():
227227
# for Carbon AquaTk, replace the default Tk apple menu
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix processing unsaved files when quitting IDLE on macOS.

0 commit comments

Comments
 (0)