mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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
This commit is contained in:
parent
f655dff807
commit
7f38ec0849
3 changed files with 98 additions and 54 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue