From: Raymond Hettinger Date: Sat, 9 Feb 2013 19:20:55 +0000 (-0500) Subject: Keep IDLE from displaying spurious SystemExit tracebacks X-Git-Tag: v2.7.4rc1~134 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4234992c750cad2bbf36f712a47515f050df549f;p=thirdparty%2FPython%2Fcpython.git Keep IDLE from displaying spurious SystemExit tracebacks when running scripts that terminated by raising SystemExit (i.e. unittest and turtledemo). --- diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index acae3aea7ad1..e82ebf4c92ae 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -301,11 +301,14 @@ class Executive(object): exec code in 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: exit() - # even print a user code SystemExit exception, continue print_exception() jit = self.rpchandler.console.getvar("<>") if jit: diff --git a/Misc/NEWS b/Misc/NEWS index 92bd686ae824..71db196a5e9c 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -205,6 +205,9 @@ Library - Issue #7358: cStringIO.StringIO now supports writing to and reading from a stream larger than 2 GiB on 64-bit systems. +- IDLE was displaying spurious SystemExit tracebacks when running scripts + that terminated by raising SystemExit (i.e. unittest and turtledemo). + - Issue #10355: In SpooledTemporaryFile class mode and name properties and xreadlines method now work for unrolled files. encoding and newlines properties now removed as they have no sense and always produced