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 | 603e508d2aac52311dd9f6dfdeaa3f02e8c0b582 (patch) | |
tree | 065ea851c9ab1b5a30d089a5b8ba1d2bb7ace474 /test/backtest.py | |
parent | 15d0c81172f7c7cd972aac85538bc5259427fd78 (diff) | |
download | python-coveragepy-603e508d2aac52311dd9f6dfdeaa3f02e8c0b582.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 4576a86..c54171d 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', '') |