Commit 2ddff0b2 authored by timurrrr@chromium.org's avatar timurrrr@chromium.org

Add a comment explaining why readline is the only way we can avoid buffering

BUG=163314
R=glider@chromium.org
NOTRY=true

Review URL: https://chromiumcodereview.appspot.com/15870005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202841 0039d316-1c4b-4281-b951-d872f2087c98
parent 8bad2cc0
...@@ -55,6 +55,8 @@ def RunSubprocess(proc, timeout=0): ...@@ -55,6 +55,8 @@ def RunSubprocess(proc, timeout=0):
if timeout > 0: if timeout > 0:
wait_until = time.time() + timeout wait_until = time.time() + timeout
while p.poll() is None and not did_timeout: while p.poll() is None and not did_timeout:
# Have to use readline rather than readlines() or "for line in p.stdout:",
# otherwise we get buffered even with bufsize=0.
line = p.stdout.readline() line = p.stdout.readline()
while line and not did_timeout: while line and not did_timeout:
sys.stdout.write(line) sys.stdout.write(line)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment