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>
diff --git a/gclient_utils.py b/gclient_utils.py
index dcf5222..6820a19 100644
--- a/gclient_utils.py
+++ b/gclient_utils.py
@@ -589,7 +589,7 @@
# 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()