# HG changeset patch # User Ned Deily # Date 1288065241 25200 # Branch py3k # Node ID 8c4d310eef3fe20932d0ccb2a34f6805f73462b4 # Parent 4463e9240acb020b65d92ffd86b8db29e0b2afb7 Issue10107: prevent exit with unsaved edit windows on IDLE built with OS X native Tk [3.x] diff -r 4463e9240acb -r 8c4d310eef3f Lib/idlelib/FileList.py --- Lib/idlelib/FileList.py Mon Oct 25 19:50:20 2010 +0200 +++ Lib/idlelib/FileList.py Mon Oct 25 20:54:01 2010 -0700 @@ -48,7 +48,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 list(self.inversedict): reply = edit.close() if reply == "cancel": diff -r 4463e9240acb -r 8c4d310eef3f Lib/idlelib/macosxSupport.py --- Lib/idlelib/macosxSupport.py Mon Oct 25 19:50:20 2010 +0200 +++ Lib/idlelib/macosxSupport.py Mon Oct 25 20:54:01 2010 -0700 @@ -102,6 +102,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