Commit 4d7d53b3 authored by Edward Lemur's avatar Edward Lemur Committed by LUCI CQ

depot_tools: Make it possible to run custom git scripts using Python 3.

Run custom git commands (e.g. git-cl, git-new-branch) using Python 3
when GCLIENT_PY3 is set to 1.

Bug: 984182
Change-Id: I81635b6cb83b2e0945d6596a7dc363f702075466
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2079704Reviewed-by: 's avatarAnthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
parent 9f6558d3
......@@ -50,10 +50,15 @@ PATH=$PATH:$DEPOT_TOOLS
if [[ $PYTHON_DIRECT = 1 ]]; then
python.exe "$DEPOT_TOOLS\\$SCRIPT" "$@"
else
if [[ -e "$DEPOT_TOOLS/python.bat" && $OSTYPE = msys ]]; then
elif [[ -e "$DEPOT_TOOLS/python.bat" && $OSTYPE = msys ]]; then
cmd.exe //c "$DEPOT_TOOLS\\vpython.bat" "$DEPOT_TOOLS\\$SCRIPT" "$@"
else
vpython "$DEPOT_TOOLS/$SCRIPT" "$@"
fi
elif [[ $GCLIENT_PY3 = 1 ]]; then
# Explicitly run on Python 3
vpython3 "$DEPOT_TOOLS/$SCRIPT" "$@"
elif [[ $GCLIENT_PY3 = 0 ]]; then
# Explicitly run on Python 2
vpython "$DEPOT_TOOLS/$SCRIPT" "$@"
else
# Run on Python 2 for now, allows default to be flipped.
vpython "$DEPOT_TOOLS/$SCRIPT" "$@"
fi
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