diff options
author | Raymond Hettinger <python@rcn.com> | 2013-02-09 19:20:55 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2013-02-09 19:20:55 (GMT) |
commit | 4234992c750cad2bbf36f712a47515f050df549f (patch) | |
tree | b869d53d5997c63fa66c1d4624a89cb421a760d3 /Lib/idlelib | |
parent | a5e7f8f8e043ff22889ad39c62130966706e36cb (diff) | |
download | cpython-4234992c750cad2bbf36f712a47515f050df549f.zip cpython-4234992c750cad2bbf36f712a47515f050df549f.tar.gz cpython-4234992c750cad2bbf36f712a47515f050df549f.tar.bz2 |
Keep IDLE from displaying spurious SystemExit tracebacks
when running scripts that terminated by raising SystemExit
(i.e. unittest and turtledemo).
Diffstat (limited to 'Lib/idlelib')
-rw-r--r-- | Lib/idlelib/run.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index acae3ae..e82ebf4c 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("<<toggle-jit-stack-viewer>>") if jit: |