diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-07-09 18:18:02 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-07-09 18:18:02 -0400 |
commit | 9dee319c84c52c8e9201e1eb919bc919668366e6 (patch) | |
tree | 7115028ad625e5065da24f5a4b55bb53c1d417d1 /coverage/backward.py | |
parent | 221822595b4e040c66937a3f9574623a9756b736 (diff) | |
download | python-coveragepy-git-9dee319c84c52c8e9201e1eb919bc919668366e6.tar.gz |
Py3k: some output is bytes instead of string, so convert since it doesn't matter.
Diffstat (limited to 'coverage/backward.py')
-rw-r--r-- | coverage/backward.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/coverage/backward.py b/coverage/backward.py index 7ee1e406..8576bbf3 100644 --- a/coverage/backward.py +++ b/coverage/backward.py @@ -46,7 +46,7 @@ else: 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. + # script. Eventually we won't need this. cmd = "python " + sys.prefix + os.sep + "Scripts" + os.sep + cmd proc = subprocess.Popen(cmd, shell=True, @@ -54,4 +54,11 @@ else: stderr=subprocess.STDOUT ) retcode = proc.wait() - return retcode, proc.stdout.read() + + # Get the output, and canonicalize it to strings with newlines. + output = proc.stdout.read() + if not isinstance(output, str): + output = output.decode('utf-8') + output = output.replace('\r', '') + + return retcode, output |