From b96466297216f5b7c1df73df7771e6234e64552d Mon Sep 17 00:00:00 2001 From: Edward Lemur Date: Fri, 25 Oct 2019 20:57:35 +0000 Subject: [PATCH] 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 Commit-Queue: Edward Lesmes --- presubmit_support.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/presubmit_support.py b/presubmit_support.py index 2fa71c0fa9..419ac1985c 100755 --- a/presubmit_support.py +++ b/presubmit_support.py @@ -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.