diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2010-02-24 20:59:45 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2010-02-24 20:59:45 -0500 |
commit | a1798a6c744d58b65e6b045d823c7c66d125f214 (patch) | |
tree | 7658ea48b62526cd78c13b9020b48f94fc51d1db /coverage/cmdline.py | |
parent | 2b638ec17b1be049a2050aca866d224b1b957630 (diff) | |
download | python-coveragepy-a1798a6c744d58b65e6b045d823c7c66d125f214.tar.gz |
When emulating the Python interpreter, don't print SystemExits tracebacks.
Diffstat (limited to 'coverage/cmdline.py')
-rw-r--r-- | coverage/cmdline.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/coverage/cmdline.py b/coverage/cmdline.py index 0ab7475..c938368 100644 --- a/coverage/cmdline.py +++ b/coverage/cmdline.py @@ -598,8 +598,13 @@ def main(): try: status = CoverageScript().command_line(sys.argv[1:]) except ExceptionDuringRun: + # An exception was caught while running the product code. The + # sys.exc_info() return tuple is packed into an ExceptionDuringRun + # exception. Note that the Python interpreter doesn't print SystemExit + # tracebacks, so it's important that we don't also. _, err, _ = sys.exc_info() - traceback.print_exception(*err.args) + if not isinstance(err.args[1], SystemExit): + traceback.print_exception(*err.args) status = ERR except CoverageException: _, err, _ = sys.exc_info() |