From 8f7bf68908351fbe790f4778307368bbf1adc455 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 25 May 2011 19:08:02 -0400 Subject: The right way to communicate with a subprocess. --- test/backtest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') 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', '') -- cgit v1.2.1