[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
This commit is contained in:
Mitch Phillips 2019-03-07 22:20:36 +00:00
parent c525b36b43
commit c90886b906
1 changed files with 2 additions and 1 deletions

View File

@ -38,7 +38,8 @@ def main():
# Find real gn executable. # Find real gn executable.
gn = 'gn' gn = 'gn'
if subprocess.call([gn, '--version'], stdout=open(os.devnull, 'w'), 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 # 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. # if it's there, or suggest to run get.py if it isn't.
platform = get_platform() platform = get_platform()