From f137e1df2c02f5782c5b0f18a2b3b649f255f63a Mon Sep 17 00:00:00 2001 From: "Kurt B. Kaiser" Date: Wed, 16 Aug 2006 07:04:17 +0000 Subject: [PATCH] Get quit() and exit() to work cleanly when not using subprocess. --- Lib/idlelib/PyShell.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index 5790483e41e..d6fd82b9f72 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -713,14 +713,17 @@ class ModifiedInterpreter(InteractiveInterpreter): else: exec code in self.locals except SystemExit: - if tkMessageBox.askyesno( - "Exit?", - "Do you want to exit altogether?", - default="yes", - master=self.tkconsole.text): - raise + 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: - self.showtraceback() + raise except: if use_subprocess: print >> self.tkconsole.stderr, \