From 43a2b30a875e14bdead28bbd819548d09e2bce8c Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 18 Sep 2010 19:11:15 -0400 Subject: If you called sys.exit() with no argument, coverage.py got tangled. Thanks, Brodie Rao. --- coverage/cmdline.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'coverage/cmdline.py') 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 -- cgit v1.2.1