gclient: Don't try opening pseudo-terminal pipes when running hooks.

As reported in crbug.com/1122671, windows bots can manage to trigger
the isatty conditional even when openpty() isn't provided.

So just force that conditional to false on windows.

Bug: 1122671
Change-Id: I2c85024da40feadd97cde7f718f4e5a4231fe9d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2386321
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Ben Pastene <bpastene@chromium.org>
changes/21/2386321/2
Ben Pastene 5 years ago committed by LUCI CQ
parent 473462adb6
commit ed15af5c4e

@ -589,7 +589,7 @@ def CheckCallAndFilter(args, print_stdout=False, filter_fn=None,
# If our stdout is a terminal, then pass in a psuedo-tty pipe to our
# subprocess when filtering its output. This makes the subproc believe
# it was launched from a terminal, which will preserve ANSI color codes.
if sys.stdout.isatty():
if sys.stdout.isatty() and GetMacWinOrLinux() != 'win':
pipe_reader, pipe_writer = os.openpty()
else:
pipe_reader, pipe_writer = os.pipe()

Loading…
Cancel
Save