Commit 045a2b88 authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[tools] Flush stdout before reading input

The last line of output (which is not terminated by a newline) was not
showing for me when running the merge script. We can either fix it by
specifying `flush=True` at the `print` statement, or flushing before
reading user input. The latter seems more future-proof.

R=machenbach@chromium.org

Change-Id: I61cb929d2f7cdd20b3e32b9beb1653fe2d5c5791
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3676857Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80890}
parent a9ca9f7d
......@@ -146,6 +146,7 @@ class SideEffectHandler(object): # pragma: no cover
return Command(cmd, args, prefix, pipe, cwd=cwd)
def ReadLine(self):
sys.stdout.flush()
return sys.stdin.readline().strip()
def ReadURL(self, url, params=None):
......@@ -693,8 +694,12 @@ def MakeStep(step_class=Step, number=0, state=None, config=None,
except AttributeError:
message = step_class.__name__
return step_class(message, number=number, config=config,
state=state, options=options,
return step_class(
message,
number=number,
config=config,
state=state,
options=options,
handler=side_effect_handler)
......
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