# HG changeset patch # User Ned Deily # Date 1288064539 25200 # Branch release27-maint # Node ID 439f5fb9c5f04a7efe121d04e7bc0f9c00fb5eb7 # Parent 1bcff58ad438799a226a2d0699e27c55a6271e27 Issue10107: prevent exit with unsaved edit windows on IDLE built with OS X native Tk diff -r 1bcff58ad438 -r 439f5fb9c5f0 Lib/idlelib/FileList.py --- Lib/idlelib/FileList.py Mon Oct 25 21:55:48 2010 +0200 +++ Lib/idlelib/FileList.py Mon Oct 25 20:42:19 2010 -0700 @@ -43,7 +43,7 @@ def new(self, filename=None): return self.EditorWindow(self, filename) - def close_all_callback(self, event): + def close_all_callback(self, *args, **kwds): for edit in self.inversedict.keys(): reply = edit.close() if reply == "cancel": diff -r 1bcff58ad438 -r 439f5fb9c5f0 Lib/idlelib/macosxSupport.py --- Lib/idlelib/macosxSupport.py Mon Oct 25 21:55:48 2010 +0200 +++ Lib/idlelib/macosxSupport.py Mon Oct 25 20:42:19 2010 -0700 @@ -96,6 +96,7 @@ root.bind('<>', config_dialog) if flist: root.bind('<>', flist.close_all_callback) + root.createcommand('exit', flist.close_all_callback) ###check if Tk version >= 8.4.14; if so, use hard-coded showprefs binding