From 26cd974abfad06add50e162a3ebf03e6bc4f793e Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Wed, 11 Nov 2020 21:35:58 +0000 Subject: [PATCH] Add a python2 shim under python2-bin/ Similarly to how python3 is available at python-bin/, this will allow developers to opt-in to a depot_tools provided python2. Bug: 1109180 Change-Id: I872eaa1289bb477da73373e99f5e6188a87d39dd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2512906 Reviewed-by: Josip Sokcevic Reviewed-by: Dirk Pranke Commit-Queue: Henrique Ferreiro --- python2-bin/python2 | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 python2-bin/python2 diff --git a/python2-bin/python2 b/python2-bin/python2 new file mode 100755 index 000000000..895275562 --- /dev/null +++ b/python2-bin/python2 @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +DEPOT_TOOLS=$(dirname "$0")/.. + +PYTHON_BIN_DIR="$DEPOT_TOOLS/$(cat $DEPOT_TOOLS/python_bin_reldir.txt | xargs echo)" +PATH="$PYTHON_BIN_DIR":"$PATH" +"$PYTHON_BIN_DIR/python" "$@"