Skip to content

Commit d605a8d

Browse files
committed
Set HERMETIC_PYTHON_VERSION correctly
PiperOrigin-RevId: 706847683
1 parent 7bea12d commit d605a8d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

oss_scripts/configure.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,13 @@ elif (which python) | grep -q "python"; then
6161
installed_python="python"
6262
fi
6363

64-
HERMETIC_PYTHON_VERSION=$($installed_python -c "import sys; print('.'.join(map(str, sys.version_info[:2])))")
64+
if [ -z "$HERMETIC_PYTHON_VERSION" ]; then
65+
if [ -n "$PY_VERSION" ]; then
66+
HERMETIC_PYTHON_VERSION=$PY_VERSION
67+
else
68+
HERMETIC_PYTHON_VERSION=$($installed_python -c "import sys; print('.'.join(map(str, sys.version_info[:2])))")
69+
fi
70+
fi
6571
export HERMETIC_PYTHON_VERSION
6672

6773
echo "TF_VERSION=$TF_VERSION"

0 commit comments

Comments
 (0)