diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2011-05-25 19:08:02 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2011-05-25 19:08:02 -0400 |
commit | 8f7bf68908351fbe790f4778307368bbf1adc455 (patch) | |
tree | 67098cd5f48b9930d269cc3ad8a0bce18992bf32 /test/backtest.py | |
parent | 511abdd3a251eb2d5c9a0dd8912c9c52c6fb52b8 (diff) | |
download | python-coveragepy-git-8f7bf68908351fbe790f4778307368bbf1adc455.tar.gz |
The right way to communicate with a subprocess.
Diffstat (limited to 'test/backtest.py')
-rw-r--r-- | test/backtest.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/backtest.py b/test/backtest.py index 4576a865..c54171d3 100644 --- a/test/backtest.py +++ b/test/backtest.py @@ -30,10 +30,10 @@ else: stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) - status = proc.wait() + output, _ = proc.communicate() + status = proc.returncode # 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', '') |