Commit 73c607aa authored by Robert Jordens's avatar Robert Jordens
Browse files

build/tools: filter with line buffering

parent 6a788911
...@@ -58,7 +58,8 @@ def sub_rules(lines, rules, max_matches=1): ...@@ -58,7 +58,8 @@ def sub_rules(lines, rules, max_matches=1):
def subprocess_call_filtered(command, rules, *, max_matches=1, **kwargs): def subprocess_call_filtered(command, rules, *, max_matches=1, **kwargs):
proc = subprocess.Popen(command, stdout=subprocess.PIPE, proc = subprocess.Popen(command, stdout=subprocess.PIPE,
universal_newlines=True, **kwargs) universal_newlines=True, bufsize=1,
**kwargs)
with proc: with proc:
for line in sub_rules(iter(proc.stdout.readline, ""), for line in sub_rules(iter(proc.stdout.readline, ""),
rules, max_matches): rules, max_matches):
......
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