summaryrefslogtreecommitdiff
path: root/coverage/cmdline.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2010-09-18 19:11:15 -0400
committerNed Batchelder <ned@nedbatchelder.com>2010-09-18 19:11:15 -0400
commit43a2b30a875e14bdead28bbd819548d09e2bce8c (patch)
tree8932f503d9479abd6ecc7faa9494c4df995680ed /coverage/cmdline.py
parentd841d4604223d8ed3db3777750a397d0c4dafd15 (diff)
downloadpython-coveragepy-git-43a2b30a875e14bdead28bbd819548d09e2bce8c.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.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/coverage/cmdline.py b/coverage/cmdline.py
index f56cc4cb..e5d6bb84 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