]> granicus.if.org Git - python/commitdiff
Get quit() and exit() to work cleanly when not using subprocess.
authorKurt B. Kaiser <kbk@shore.net>
Wed, 16 Aug 2006 07:04:17 +0000 (07:04 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Wed, 16 Aug 2006 07:04:17 +0000 (07:04 +0000)
Lib/idlelib/PyShell.py

index 5790483e41e338499736a924b20995f4c567a5a2..d6fd82b9f72135e12ec46e76ec685e8510dcbb41 100644 (file)
@@ -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, \