summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/ScriptBinding.py
diff options
context:
space:
mode:
authorKurt B. Kaiser <kbk@shore.net>2003-05-15 03:19:42 (GMT)
committerKurt B. Kaiser <kbk@shore.net>2003-05-15 03:19:42 (GMT)
commit7f38ec0849fd2b19e660350c59d42b8b5cfae2d1 (patch)
tree243051301d3e14045e8b118b83ab7fa7d8719e05 /Lib/idlelib/ScriptBinding.py
parentf655dff80782cd6bf59d64985299bd07546cb98b (diff)
downloadcpython-7f38ec0849fd2b19e660350c59d42b8b5cfae2d1.zip
cpython-7f38ec0849fd2b19e660350c59d42b8b5cfae2d1.tar.gz
cpython-7f38ec0849fd2b19e660350c59d42b8b5cfae2d1.tar.bz2
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
Diffstat (limited to 'Lib/idlelib/ScriptBinding.py')
-rw-r--r--Lib/idlelib/ScriptBinding.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/Lib/idlelib/ScriptBinding.py b/Lib/idlelib/ScriptBinding.py
index 9604cb8..d404fc9 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