Fix python3 wrapper for msys.

The python3_bin_reldir.txt path to find the python binary will
contain backslashes instead of forward slashes on windows, so
this tweaks the wrapper in //python-bin/python3 to handle that
and start working under msys.

Bug: 1168365
Change-Id: I0c83f36f48f229276803c2e5d73ec86ecb55ada1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2721367
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
diff --git a/python-bin/python3 b/python-bin/python3
index 87cf0ca..eec3590 100755
--- a/python-bin/python3
+++ b/python-bin/python3
@@ -2,6 +2,11 @@
 
 DEPOT_TOOLS=$(dirname "$0")/..
 
-PYTHON3_BIN_DIR="$DEPOT_TOOLS/$(cat $DEPOT_TOOLS/python3_bin_reldir.txt | xargs echo)"
+if [ "$OSTYPE" = "msys" ]
+then
+  PYTHON3_BIN_DIR="$DEPOT_TOOLS/$(sed -e 's-\\-/-g' $DEPOT_TOOLS/python3_bin_reldir.txt)"
+else
+  PYTHON3_BIN_DIR="$DEPOT_TOOLS/$(cat $DEPOT_TOOLS/python3_bin_reldir.txt)"
+fi
 PATH="$PYTHON3_BIN_DIR":"$PYTHON3_BIN_DIR/Scripts":"$PATH"
 "$PYTHON3_BIN_DIR/python3" "$@"