[Python-checkins] r51308 - python/trunk/Lib/idlelib/PyShell.py

kurt.kaiser python-checkins at python.org
Wed Aug 16 09:04:17 CEST 2006


Author: kurt.kaiser
Date: Wed Aug 16 09:04:17 2006
New Revision: 51308

Modified:
   python/trunk/Lib/idlelib/PyShell.py
Log:
Get quit() and exit() to work cleanly when not using subprocess.


Modified: python/trunk/Lib/idlelib/PyShell.py
==============================================================================
--- python/trunk/Lib/idlelib/PyShell.py	(original)
+++ python/trunk/Lib/idlelib/PyShell.py	Wed Aug 16 09:04:17 2006
@@ -713,14 +713,17 @@
                 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, \


More information about the Python-checkins mailing list