diff options
| author | Ned Batchelder <ned@nedbatchelder.com> | 2010-09-18 19:11:15 -0400 |
|---|---|---|
| committer | Ned Batchelder <ned@nedbatchelder.com> | 2010-09-18 19:11:15 -0400 |
| commit | f4405db0cbc5d265b8ac8846596a9e3fab285305 (patch) | |
| tree | 3846b93779c2773c99cf61992a819732ad245a76 /coverage/cmdline.py | |
| parent | ecc8c0ecbb57a4294a94e316db12e1f5d34d5f40 (diff) | |
| download | python-coveragepy-f4405db0cbc5d265b8ac8846596a9e3fab285305.tar.gz | |
If you called sys.exit() with no argument, coverage.py got tangled. Thanks, Brodie Rao.
Diffstat (limited to 'coverage/cmdline.py')
| -rw-r--r-- | coverage/cmdline.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/coverage/cmdline.py b/coverage/cmdline.py index f56cc4c..e5d6bb8 100644 --- a/coverage/cmdline.py +++ b/coverage/cmdline.py @@ -652,7 +652,10 @@ def main(argv=None): print(err) status = ERR except SystemExit: - # The user called `sys.exit()`. Exit with their status code. + # The user called `sys.exit()`. Exit with their argument, if any. _, err, _ = sys.exc_info() - status = err.args[0] + if err.args: + status = err.args[0] + else: + status = None return status |
