mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
Clean up ModifiedInterpreter.runcode() structure
This commit is contained in:
parent
ecf796ed43
commit
dddeb0eec4
1 changed files with 29 additions and 27 deletions
|
|
@ -706,7 +706,6 @@ def runcode(self, code):
|
|||
debugger = self.debugger
|
||||
try:
|
||||
self.tkconsole.beginexecuting()
|
||||
try:
|
||||
if not debugger and self.rpcclt is not None:
|
||||
self.active_seq = self.rpcclt.asyncqueue("exec", "runcode",
|
||||
(code,), {})
|
||||
|
|
@ -728,13 +727,16 @@ def runcode(self, code):
|
|||
raise
|
||||
except:
|
||||
if use_subprocess:
|
||||
# When run w/o subprocess, both user and IDLE errors
|
||||
# are printed here; skip message in that case.
|
||||
print >> self.tkconsole.stderr, \
|
||||
print >>self.tkconsole.stderr, \
|
||||
"IDLE internal error in runcode()"
|
||||
self.showtraceback()
|
||||
if use_subprocess:
|
||||
self.tkconsole.endexecuting()
|
||||
else:
|
||||
if self.tkconsole.canceled:
|
||||
self.tkconsole.canceled = False
|
||||
print >>self.tkconsole.stderr, "KeyboardInterrupt"
|
||||
else:
|
||||
self.showtraceback()
|
||||
finally:
|
||||
if not use_subprocess:
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue