summaryrefslogtreecommitdiff
path: root/coverage/backward.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-07-09 10:50:23 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-07-09 10:50:23 -0400
commit831cbf4e7ef69eca24034425a887aa774f765fd8 (patch)
tree09a2af3bd95e87eb161e45a0e2dba0af1a4e9baa /coverage/backward.py
parent829cde3cb6fcd15ebf884446b6a27d7e2dc7aadb (diff)
downloadpython-coveragepy-git-831cbf4e7ef69eca24034425a887aa774f765fd8.tar.gz
Have the tests use the script explicitly until I can figure out how to install a usable script for Py3k
Diffstat (limited to 'coverage/backward.py')
-rw-r--r--coverage/backward.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/coverage/backward.py b/coverage/backward.py
index 91f07bf6..7ee1e406 100644
--- a/coverage/backward.py
+++ b/coverage/backward.py
@@ -4,7 +4,7 @@
# (Redefining built-in blah)
# The whole point of this file is to redefine built-ins, so shut up about it.
-import os
+import os, sys
# Python 2.3 doesn't have `set`
try:
@@ -43,6 +43,12 @@ else:
Returns the exit code and the combined stdout and stderr.
"""
+
+ if sys.hexversion > 0x03000000 and cmd.startswith("coverage "):
+ # We don't have a coverage command on 3.x, so fix it up to call the
+ # script.
+ cmd = "python " + sys.prefix + os.sep + "Scripts" + os.sep + cmd
+
proc = subprocess.Popen(cmd, shell=True,
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT