From 7f38ec0849fd2b19e660350c59d42b8b5cfae2d1 Mon Sep 17 00:00:00 2001 From: "Kurt B. Kaiser" Date: Thu, 15 May 2003 03:19:42 +0000 Subject: 1. Restore the capability to run and debug without a subprocess. 2. Add an indicator to the shell startup notice when running w/o subprocess. 3. Improve exception reporting when running a command or script from the command line. 4. Clarify the fact that breakpoints set or cleared after a file is saved will revert to the saved state if the file is closed without re-saving. 5. If user tries to exit or restart when user code is running, interrupt the user code. This helps to eliminate occasional hanging subprocesses on Windows (except for Freddy :). M NEWS.txt M PyShell.py M ScriptBinding.py --- Lib/idlelib/ScriptBinding.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'Lib/idlelib/ScriptBinding.py') diff --git a/Lib/idlelib/ScriptBinding.py b/Lib/idlelib/ScriptBinding.py index 9604cb8618..d404fc90ce 100644 --- a/Lib/idlelib/ScriptBinding.py +++ b/Lib/idlelib/ScriptBinding.py @@ -22,6 +22,7 @@ import string import tabnanny import tokenize import tkMessageBox +import PyShell IDENTCHARS = string.ascii_letters + string.digits + "_" @@ -38,8 +39,6 @@ To fix case 2, change all tabs to spaces by using Select All followed \ by Untabify Region (both in the Edit menu).""" -# XXX 11Jun02 KBK TBD Implement stop-execution - class ScriptBinding: menudefs = [ @@ -124,7 +123,19 @@ class ScriptBinding: flist = self.editwin.flist shell = flist.open_shell() interp = shell.interp - interp.restart_subprocess() + if PyShell.use_subprocess: + shell.restart_shell() + if shell.executing: + delay = 2700 + else: + delay = 500 + # Wait for the interrupt and reset to finish + shell.text.after(delay, self.run_module_event2, interp, + filename, code) + else: + self.run_module_event2(interp, filename, code) + + def run_module_event2(self, interp, filename, code): # XXX Too often this discards arguments the user just set... interp.runcommand("""if 1: _filename = %s -- cgit v1.2.1