summaryrefslogtreecommitdiff
path: root/coverage/execfile.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2013-12-14 14:17:56 -0500
committerNed Batchelder <ned@nedbatchelder.com>2013-12-14 14:17:56 -0500
commita0141e1324bccc4dffc1054de013826874497762 (patch)
tree139ddf1046dbe083f80699fb866d1b7395ecc3de /coverage/execfile.py
parent124e04f9077cc2b76f9eb28e5f8b7c49a26c4452 (diff)
downloadpython-coveragepy-a0141e1324bccc4dffc1054de013826874497762.tar.gz
No need for paren-less exec any more.
Diffstat (limited to 'coverage/execfile.py')
-rw-r--r--coverage/execfile.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/coverage/execfile.py b/coverage/execfile.py
index f90096e..7b90137 100644
--- a/coverage/execfile.py
+++ b/coverage/execfile.py
@@ -2,7 +2,7 @@
import imp, marshal, os, sys
-from coverage.backward import exec_code_object, open_source
+from coverage.backward import open_source
from coverage.misc import ExceptionDuringRun, NoCode, NoSource
@@ -99,7 +99,7 @@ def run_python_file(filename, args, package=None):
# Execute the code object.
try:
- exec_code_object(code, main_mod.__dict__)
+ exec(code, main_mod.__dict__)
except SystemExit:
# The user called sys.exit(). Just pass it along to the upper
# layers, where it will be handled.
@@ -107,11 +107,11 @@ def run_python_file(filename, args, package=None):
except:
# Something went wrong while executing the user code.
# Get the exc_info, and pack them into an exception that we can
- # throw up to the outer loop. We peel two layers off the traceback
+ # throw up to the outer loop. We peel one layer off the traceback
# so that the coverage.py code doesn't appear in the final printed
# traceback.
typ, err, tb = sys.exc_info()
- raise ExceptionDuringRun(typ, err, tb.tb_next.tb_next)
+ raise ExceptionDuringRun(typ, err, tb.tb_next)
finally:
# Restore the old __main__
sys.modules['__main__'] = old_main_mod