Commit 6f18e687 authored by Edward Lemur's avatar Edward Lemur Committed by Commit Bot

gclient: Execute python hooks using vpython.

Change-Id: I032c838c07ca8b715976bd9dc428c1bd6a77d80b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1793009Reviewed-by: 's avatarDirk Pranke <dpranke@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
parent fdb59f0d
......@@ -242,12 +242,7 @@ class Hook(object):
cmd = [arg for arg in self._action]
if cmd[0] == 'python':
# If the hook specified "python" as the first item, the action is a
# Python script. Run it by starting a new copy of the same interpreter if
# we're running on Python 2.
# When using vpython3, "python" refers to the Python 3 executable used by
# vpython3, so use "vpython" instead.
cmd[0] = sys.executable if six.PY2 else 'vpython'
cmd[0] = 'vpython'
if cmd[0] == 'vpython' and _detect_host_os() == 'win':
cmd[0] += '.bat'
......
......@@ -734,10 +734,9 @@ class GClientSmokeGIT(GClientSmokeBase):
('running', self.root_dir), # pre-deps hook
('running', self.root_dir), # pre-deps hook (fails)
]
executable = sys.executable if sys.version_info.major == 2 else 'vpython'
expected_stderr = ("Error: Command '%s -c import sys; "
expected_stderr = ("Error: Command 'vpython -c import sys; "
"sys.exit(1)' returned non-zero exit status 1 in %s\n"
% (executable, self.root_dir))
% self.root_dir)
stdout, stderr, retcode = self.gclient(['sync', '--deps', 'mac', '--jobs=1',
'--revision',
'src@' + self.githash('repo_5', 3)])
......
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