summaryrefslogtreecommitdiff
path: root/coverage/execfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'coverage/execfile.py')
-rw-r--r--coverage/execfile.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/coverage/execfile.py b/coverage/execfile.py
index 1a2ffadd..333163f8 100644
--- a/coverage/execfile.py
+++ b/coverage/execfile.py
@@ -51,6 +51,10 @@ def run_python_file(filename, args):
# Execute the source file.
try:
exec_code_object(code, main_mod.__dict__)
+ except SystemExit:
+ # The user called sys.exit(). Just pass it along to the upper
+ # layers, where it will be handled.
+ raise
except:
# Something went wrong while executing the user code.
# Get the exc_info, and pack them into an exception that we can