diff options
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 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 |