diff options
Diffstat (limited to 'Lib/idlelib/ScriptBinding.py')
-rw-r--r-- | Lib/idlelib/ScriptBinding.py | 17 |
1 files changed, 14 insertions, 3 deletions
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 |