summaryrefslogtreecommitdiff
path: root/coverage/backward.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
commit16e945af086211306ea921de5d02d232f0ec7658 (patch)
tree7f53bffd96102933ede60f83b1a82e8504d5664c /coverage/backward.py
parentaf4165234cd74880a7f6a114e01dc4d3e5a1d56f (diff)
downloadpython-coveragepy-git-16e945af086211306ea921de5d02d232f0ec7658.tar.gz
No need for paren-less exec any more.
Diffstat (limited to 'coverage/backward.py')
-rw-r--r--coverage/backward.py17
1 files changed, 0 insertions, 17 deletions
diff --git a/coverage/backward.py b/coverage/backward.py
index 8237d01b..a0dc9027 100644
--- a/coverage/backward.py
+++ b/coverage/backward.py
@@ -45,23 +45,6 @@ else:
"""Produce the items from dict `d`."""
return d.iteritems()
-# Exec is a statement in Py2, a function in Py3
-if sys.version_info >= (3, 0):
- def exec_code_object(code, global_map):
- """A wrapper around exec()."""
- exec(code, global_map)
-else:
- # OK, this is pretty gross. In Py2, exec was a statement, but that will
- # be a syntax error if we try to put it in a Py3 file, even if it is never
- # executed. So hide it inside an evaluated string literal instead.
- eval(
- compile(
- "def exec_code_object(code, global_map):\n"
- " exec code in global_map\n",
- "<exec_function>", "exec"
- )
- )
-
# Reading Python source and interpreting the coding comment is a big deal.
if sys.version_info >= (3, 0):
# Python 3.2 provides `tokenize.open`, the best way to open source files.