Index: lib/sanitizer_common/scripts/check_lint.sh =================================================================== --- lib/sanitizer_common/scripts/check_lint.sh +++ lib/sanitizer_common/scripts/check_lint.sh @@ -10,6 +10,17 @@ # python tools setup CPPLINT=${SCRIPT_DIR}/cpplint.py LITLINT=${SCRIPT_DIR}/litlint.py +if [ -z "${PYTHON_EXECUTABLE}" ] && [ ! -x /usr/bin/python ]; then + if [ -x /usr/local/bin/python ]; then + PYTHON_EXECUTABLE=/usr/local/bin/python + elif PYTHON_EXECUTABLE=$(which python 2>/dev/null); then + echo "Using python executable $PYTHON_EXECUTABLE from \$PATH." + else + echo "Python not found in /usr/bin/python, /usr/local/bin/python, or \$PATH." + echo "Set the PYTHON_EXECUTABLE environment variable to the path to your python." + exit 1 + fi +fi if [ "${PYTHON_EXECUTABLE}" != "" ]; then CPPLINT="${PYTHON_EXECUTABLE} ${CPPLINT}" LITLINT="${PYTHON_EXECUTABLE} ${LITLINT}"