diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2016-12-26 10:25:25 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2016-12-26 10:25:25 -0500 |
commit | 6bd501ea9137ff82f0d2212fb29451161a61e1cf (patch) | |
tree | 423eebbf47bde75389f2c85634d615cf65db6e95 /coverage | |
parent | cab19c985170aa63675ee12dcc7d8a467578fa7a (diff) | |
download | python-coveragepy-6bd501ea9137ff82f0d2212fb29451161a61e1cf.tar.gz |
Suppress the coverage.py frame when reporting exceptions
Diffstat (limited to 'coverage')
-rw-r--r-- | coverage/execfile.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/coverage/execfile.py b/coverage/execfile.py index 9ac7181..693f54f 100644 --- a/coverage/execfile.py +++ b/coverage/execfile.py @@ -201,6 +201,8 @@ def run_python_file(filename, args, package=None, modulename=None, path0=None): # Call the excepthook. try: + if hasattr(err, "__traceback__"): + err.__traceback__ = err.__traceback__.tb_next sys.excepthook(typ, err, tb.tb_next) except SystemExit: raise |