--- Lib/idlelib/ScriptBinding.py 2011-03-13 17:07:51.000000000 -0400 +++ /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/ScriptBinding.py 2011-03-15 16:46:09.000000000 -0400 @@ -52,6 +52,8 @@ self.flist = self.editwin.flist self.root = self.editwin.root + self.editwin.text_frame.bind('<>', self._run_module_event) + def check_module_event(self, event): filename = self.getfilename() if not filename: @@ -116,14 +118,18 @@ shell.set_warning_stream(saved_stream) def run_module_event(self, event): + self.editwin.text_frame.after(50, lambda: self.editwin.text_frame.event_generate('<>')) + return 'break' + + def _run_module_event(self, *event): """Run the module after setting up the environment. First check the syntax. If OK, make sure the shell is active and then transfer the arguments, set the run environment's working directory to the directory of the module being executed and also add that directory to its sys.path if not already included. - """ + filename = self.getfilename() if not filename: return 'break'