Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(327)

Side by Side Diff: scripts/tools/runit.py

Issue 914303007: Fix runit.py script on windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: prepend executable for all platforms Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2013 The Chromium Authors. All rights reserved. 2 # Copyright 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Runs a command with PYTHONPATH set up for the Chromium build setup. 6 """Runs a command with PYTHONPATH set up for the Chromium build setup.
7 7
8 This is helpful for running scripts locally on a development machine. 8 This is helpful for running scripts locally on a development machine.
9 9
10 Try `scripts/common/runit.py python` 10 Try `scripts/common/runit.py python`
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 option_parser.error('Must provide a command to run.') 79 option_parser.error('Must provide a command to run.')
80 80
81 path = os.environ.get('PYTHONPATH', '').split(os.pathsep) 81 path = os.environ.get('PYTHONPATH', '').split(os.pathsep)
82 add_build_paths(path) 82 add_build_paths(path)
83 os.environ['PYTHONPATH'] = os.pathsep.join(path) 83 os.environ['PYTHONPATH'] = os.pathsep.join(path)
84 84
85 if options.show_path: 85 if options.show_path:
86 print 'Set PYTHONPATH: %s' % os.environ['PYTHONPATH'] 86 print 'Set PYTHONPATH: %s' % os.environ['PYTHONPATH']
87 87
88 # Use subprocess instead of execv because otherwise windows destroys quoting. 88 # Use subprocess instead of execv because otherwise windows destroys quoting.
89 p = subprocess.Popen(args) 89 p = subprocess.Popen([sys.executable] + args)
90 p.wait() 90 p.wait()
91 return p.returncode 91 return p.returncode
92 92
93 93
94 if __name__ == '__main__': 94 if __name__ == '__main__':
95 sys.exit(main()) 95 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698