Skip to content

Commit

Permalink
A couple of cleanups for gyp_chromium
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
sbc100 authored and Commit bot committed May 21, 2015
1 parent 49457c6 commit bf94627
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions build/gyp_chromium
Original file line number Diff line number Diff line change
Expand Up @@ -227,19 +227,12 @@ if __name__ == '__main__':
'python2*_bin')))[-1]
env = os.environ.copy()
env['PATH'] = python_dir + os.pathsep + env.get('PATH', '')
p = subprocess.Popen(
[os.path.join(python_dir, 'python.exe')] + sys.argv,
env=env, shell=False)
p.communicate()
sys.exit(p.returncode)
cmd = [os.path.join(python_dir, 'python.exe')] + sys.argv
sys.exit(subprocess.call(cmd, env=env))

# This could give false positives since it doesn't actually do real option
# parsing. Oh well.
gyp_file_specified = False
for arg in args:
if arg.endswith('.gyp'):
gyp_file_specified = True
break
gyp_file_specified = any(arg.endswith('.gyp') for arg in args)

gyp_environment.SetEnvironment()

Expand Down

0 comments on commit bf94627

Please sign in to comment.