From ed15af5c4eedfedd144fc9b3557dda1a977758c7 Mon Sep 17 00:00:00 2001 From: Ben Pastene Date: Mon, 31 Aug 2020 22:06:53 +0000 Subject: [PATCH] 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 Commit-Queue: Ben Pastene --- gclient_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gclient_utils.py b/gclient_utils.py index dcf52224e..6820a19a1 100644 --- a/gclient_utils.py +++ b/gclient_utils.py @@ -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()