From c90886b906febb0d02a5c7d4720001d4085a7c0a Mon Sep 17 00:00:00 2001 From: Mitch Phillips Date: Thu, 7 Mar 2019 22:20:36 +0000 Subject: [PATCH] [GN] Locate prebuilt binaries correctly. Use the system shell to see if we can find a 'gn' binary on $PATH. This solves the error wherein subprocess.call fails ungracefully if the binary doesn't exist. llvm-svn: 355645 --- llvm/utils/gn/gn.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/utils/gn/gn.py b/llvm/utils/gn/gn.py index f523e64..73f2c80 100755 --- a/llvm/utils/gn/gn.py +++ b/llvm/utils/gn/gn.py @@ -38,7 +38,8 @@ def main(): # Find real gn executable. gn = 'gn' if subprocess.call([gn, '--version'], stdout=open(os.devnull, 'w'), - stderr=subprocess.STDOUT) != 0: + stderr=subprocess.STDOUT, + shell=True) != 0: # Not on path. See if get.py downloaded a prebuilt binary and run that # if it's there, or suggest to run get.py if it isn't. platform = get_platform() -- 2.7.4