Index: python_runner.sh |
diff --git a/python_runner.sh b/python_runner.sh |
index bf9f624dd869834c15bb842bd858e0d5880a5e9e..ee331fc94833f9c0700894487fdaac2a28e4bd30 100755 |
--- a/python_runner.sh |
+++ b/python_runner.sh |
@@ -41,10 +41,15 @@ if [[ "$DEPOT_TOOLS" = "$0" ]]; then |
else |
BASENAME="${0##*\\}" |
fi |
+ |
SCRIPT="${SCRIPT-${BASENAME//-/_}.py}" |
-if [[ -e "$DEPOT_TOOLS/python.bat" && $OSTYPE = msys ]]; then |
- cmd.exe //c "$DEPOT_TOOLS\\python.bat" "$DEPOT_TOOLS\\$SCRIPT" "$@" |
+if [[ $PYTHON_DIRECT = 1 ]]; then |
+ python.exe "$DEPOT_TOOLS\\$SCRIPT" "$@" |
else |
- exec "$DEPOT_TOOLS/$SCRIPT" "$@" |
+ if [[ -e "$DEPOT_TOOLS/python.bat" && $OSTYPE = msys ]]; then |
+ cmd.exe //c "$DEPOT_TOOLS\\python.bat" "$DEPOT_TOOLS\\$SCRIPT" "$@" |
+ else |
+ exec "$DEPOT_TOOLS/$SCRIPT" "$@" |
+ fi |
fi |