mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
gclient: Execute python hooks using vpython.
Change-Id: I032c838c07ca8b715976bd9dc428c1bd6a77d80b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1793009 Reviewed-by: Dirk Pranke <dpranke@chromium.org> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This commit is contained in:
@@ -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)])
|
||||
|
||||
Reference in New Issue
Block a user