Additional python version retrieval filter.

PiperOrigin-RevId: 236407702
This commit is contained in:
A. Unique TensorFlower 2019-03-01 17:30:18 -08:00 committed by TensorFlower Gardener
parent ebeb598c2d
commit 0c702c4f95

View File

@ -208,7 +208,7 @@ if [[ -z "$PYTHON_BIN_PATH" ]]; then
die "Error: PYTHON_BIN_PATH was not provided. Did you run configure?" die "Error: PYTHON_BIN_PATH was not provided. Did you run configure?"
fi fi
# Get python version for configuring pip later in installation. # Get python version for configuring pip later in installation.
PYTHON_VER_CFG=$(${PYTHON_BIN_PATH} -V 2>&1 | awk '{print $2}' | cut -d. -f-2) PYTHON_VER_CFG=$(${PYTHON_BIN_PATH} -V 2>&1 | awk '{print $2}' | cut -d. -f-2 | cut -c1-3)
echo "PYTHON_BIN_PATH: ${PYTHON_BIN_PATH} (version: ${PYTHON_VER_CFG})" echo "PYTHON_BIN_PATH: ${PYTHON_BIN_PATH} (version: ${PYTHON_VER_CFG})"
# Default values for optional global variables in case they are not user # Default values for optional global variables in case they are not user
@ -239,7 +239,7 @@ PIP_WHL_DIR=$(realpath "${PIP_WHL_DIR}") # Get absolute path
WHL_PATH="" WHL_PATH=""
# Determine the major.minor versions of python being used (e.g., 2.7). # Determine the major.minor versions of python being used (e.g., 2.7).
# Useful for determining the directory of the local pip installation. # Useful for determining the directory of the local pip installation.
PY_MAJOR_MINOR_VER=$(${PYTHON_BIN_PATH} -V 2>&1 | awk '{print $2}' | cut -d. -f-2) PY_MAJOR_MINOR_VER=$(${PYTHON_BIN_PATH} -V 2>&1 | awk '{print $2}' | cut -d. -f-2 | cut -c1-3)
if [[ -z "${PY_MAJOR_MINOR_VER}" ]]; then if [[ -z "${PY_MAJOR_MINOR_VER}" ]]; then
die "ERROR: Unable to determine the major.minor version of Python." die "ERROR: Unable to determine the major.minor version of Python."
fi fi