Better tooling

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299614 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/python_runner.sh b/python_runner.sh
index bf9f624..2834d14 100755
--- a/python_runner.sh
+++ b/python_runner.sh
@@ -41,10 +41,15 @@
 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