Skip to content

Commit 1d0161f

Browse files
authored
Merge pull request #408 from antifuchs/line-buffer-effects
buildbot-effects: Don't manually handle stdout/err
2 parents f2e3a0b + 33efd75 commit 1d0161f

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

buildbot_effects/buildbot_effects/__init__.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -260,18 +260,11 @@ def run_effects(
260260
with pipe() as (r_file, w_file):
261261
if debug:
262262
print("$", shlex.join(bubblewrap_cmd), file=sys.stderr)
263-
proc = subprocess.Popen(
263+
proc = subprocess.run(
264264
bubblewrap_cmd,
265-
text=True,
265+
check=False,
266266
stdin=subprocess.DEVNULL,
267-
stdout=w_file,
268-
stderr=w_file,
269267
)
270-
w_file.close()
271-
with proc:
272-
for line in r_file:
273-
print(line, end="")
274-
proc.wait()
275-
if proc.returncode != 0:
276-
msg = f"command failed with exit code {proc.returncode}"
277-
raise BuildbotEffectsError(msg)
268+
if proc.returncode != 0:
269+
msg = f"command failed with exit code {proc.returncode}"
270+
raise BuildbotEffectsError(msg)

0 commit comments

Comments
 (0)