[Python-checkins] cpython (3.3): #18196: Avoid displaying spurious SystemExit tracebacks.

roger.serwy python-checkins at python.org
Wed Jun 12 05:24:49 CEST 2013


http://hg.python.org/cpython/rev/0e56d4e37777
changeset:   84098:0e56d4e37777
branch:      3.3
parent:      84096:da852f5250af
user:        Roger Serwy <roger.serwy at gmail.com>
date:        Tue Jun 11 22:25:14 2013 -0500
summary:
  #18196: Avoid displaying spurious SystemExit tracebacks.

files:
  Lib/idlelib/run.py |  4 ++++
  Misc/NEWS          |  2 ++
  2 files changed, 6 insertions(+), 0 deletions(-)


diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py
--- a/Lib/idlelib/run.py
+++ b/Lib/idlelib/run.py
@@ -339,6 +339,10 @@
                 exec(code, self.locals)
             finally:
                 interruptable = False
+        except SystemExit:
+            # Scripts that raise SystemExit should just
+            # return to the interactive prompt
+            pass
         except:
             self.usr_exc_info = sys.exc_info()
             if quitting:
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -81,6 +81,8 @@
 IDLE
 ----
 
+- Issue #18196: Avoid displaying spurious SystemExit tracebacks.
+
 - Issue #5492: Avoid traceback when exiting IDLE caused by a race condition.
 
 - Issue #17511: Keep IDLE find dialog open after clicking "Find Next".

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list