presubmit_support: Set python_executable to vpython.

PRESUBMIT.py scripts might execute commands directly instead of using
CallCommand, so that the conversion to vpython is bypassed, resulting in
errors.

See e.g.
https://cs.chromium.org/chromium/src/third_party/blink/web_tests/PRESUBMIT.py?l=79

Bug: 1017410
Change-Id: If1943fe46cd2fc1e37b89aee14865429f884332b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1879493
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
changes/93/1879493/2
Edward Lemur 6 years ago committed by Commit Bot
parent 4861444124
commit b964662972

@ -558,11 +558,10 @@ class InputApi(object):
self.is_windows = sys.platform == 'win32'
# Set python_executable to 'python'. This is interpreted in CallCommand to
# convert to vpython in order to allow scripts in other repos (e.g. src.git)
# to automatically pick up that repo's .vpython file, instead of inheriting
# the one in depot_tools.
self.python_executable = 'python'
# Set python_executable to 'vpython' in order to allow scripts in other
# repos (e.g. src.git) to automatically pick up that repo's .vpython file,
# instead of inheriting the one in depot_tools.
self.python_executable = 'vpython'
self.environ = os.environ
# InputApi.platform is the platform you're currently running on.

Loading…
Cancel
Save