Fix version extraction for oddball Python's with multiline versions.

PiperOrigin-RevId: 236474551
This commit is contained in:
Martin Wicke 2019-03-02 12:10:54 -08:00 committed by TensorFlower Gardener
parent f1bbf1d83e
commit 5060a82990

View File

@ -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 | cut -c1-3) PY_MAJOR_MINOR_VER=$(${PYTHON_BIN_PATH} -V 2>&1 | head -n 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