Commit bf94627a authored by sbc's avatar sbc Committed by Commit bot

A couple of cleanups for gyp_chromium

Use subprocess.call() rather than Popen + communicate.
The shell argument to Popen defaults to False so was
redundant.

Use any() rather than explicit loop.

Review URL: https://codereview.chromium.org/1144383002

Cr-Commit-Position: refs/heads/master@{#330854}
parent 49457c64
...@@ -227,19 +227,12 @@ if __name__ == '__main__': ...@@ -227,19 +227,12 @@ if __name__ == '__main__':
'python2*_bin')))[-1] 'python2*_bin')))[-1]
env = os.environ.copy() env = os.environ.copy()
env['PATH'] = python_dir + os.pathsep + env.get('PATH', '') env['PATH'] = python_dir + os.pathsep + env.get('PATH', '')
p = subprocess.Popen( cmd = [os.path.join(python_dir, 'python.exe')] + sys.argv
[os.path.join(python_dir, 'python.exe')] + sys.argv, sys.exit(subprocess.call(cmd, env=env))
env=env, shell=False)
p.communicate()
sys.exit(p.returncode)
# This could give false positives since it doesn't actually do real option # This could give false positives since it doesn't actually do real option
# parsing. Oh well. # parsing. Oh well.
gyp_file_specified = False gyp_file_specified = any(arg.endswith('.gyp') for arg in args)
for arg in args:
if arg.endswith('.gyp'):
gyp_file_specified = True
break
gyp_environment.SetEnvironment() gyp_environment.SetEnvironment()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment