Get quit() and exit() to work cleanly when not using subprocess.

This commit is contained in:
Kurt B. Kaiser 2006-08-16 07:04:17 +00:00
parent b1cb56ad17
commit f137e1df2c
1 changed files with 10 additions and 7 deletions

View File

@ -713,6 +713,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
else: else:
exec code in self.locals exec code in self.locals
except SystemExit: except SystemExit:
if not self.tkconsole.closing:
if tkMessageBox.askyesno( if tkMessageBox.askyesno(
"Exit?", "Exit?",
"Do you want to exit altogether?", "Do you want to exit altogether?",
@ -721,6 +722,8 @@ class ModifiedInterpreter(InteractiveInterpreter):
raise raise
else: else:
self.showtraceback() self.showtraceback()
else:
raise
except: except:
if use_subprocess: if use_subprocess:
print >> self.tkconsole.stderr, \ print >> self.tkconsole.stderr, \