Fix output flushing when getting warnings that should prompt in py3.

When presubmit checks create warnings that should raise a prompt
whether or not to continue, the output wasn't being flushed
properly under python3.

Bug: 1213316
Change-Id: Ibb4b4d965d49f0cd65ccc0737282e5f5b5f58004
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2921323
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Dirk Pranke <dpranke@google.com>
changes/23/2921323/2
Dirk Pranke 4 years ago committed by LUCI CQ
parent 85557a08f4
commit 7288f88590

@ -296,6 +296,7 @@ def _RightHandSideLinesImpl(affected_files):
def prompt_should_continue(prompt_string):
sys.stdout.write(prompt_string)
sys.stdout.flush()
response = sys.stdin.readline().strip().lower()
return response in ('y', 'yes')

Loading…
Cancel
Save