summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/PyShell.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/idlelib/PyShell.py')
-rw-r--r--Lib/idlelib/PyShell.py54
1 files changed, 28 insertions, 26 deletions
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
index 4c16db9..b16bbc0 100644
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -706,34 +706,36 @@ class ModifiedInterpreter(InteractiveInterpreter):
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,), {})
- elif debugger:
- debugger.run(code, self.locals)
- else:
- exec(code, self.locals)
- except SystemExit:
- if not self.tkconsole.closing:
- if tkMessageBox.askyesno(
- "Exit?",
- "Do you want to exit altogether?",
- default="yes",
- master=self.tkconsole.text):
- raise
- else:
- self.showtraceback()
- else:
+ if not debugger and self.rpcclt is not None:
+ self.active_seq = self.rpcclt.asyncqueue("exec", "runcode",
+ (code,), {})
+ elif debugger:
+ debugger.run(code, self.locals)
+ else:
+ exec(code, self.locals)
+ except SystemExit:
+ if not self.tkconsole.closing:
+ if tkMessageBox.askyesno(
+ "Exit?",
+ "Do you want to exit altogether?",
+ default="yes",
+ master=self.tkconsole.text):
raise
- except:
- if use_subprocess:
- # When run w/o subprocess, both user and IDLE errors
- # are printed here; skip message in that case.
- print("IDLE internal error in runcode()", file=self.tkconsole.stderr)
+ else:
+ else:
+ raise
+ except:
+ if use_subprocess:
+ print("IDLE internal error in runcode()",
+ file=self.tkconsole.stderr)
self.showtraceback()
- if use_subprocess:
- self.tkconsole.endexecuting()
+ self.tkconsole.endexecuting()
+ else:
+ if self.tkconsole.canceled:
+ self.tkconsole.canceled = False
+ print("KeyboardInterrupt", file=self.tkconsole.stderr)
+ else:
+ self.showtraceback()
finally:
if not use_subprocess:
try: