Merge "Detect EL8 platform-python" into stable/train

This commit is contained in:
Zuul 2021-10-08 13:12:51 +00:00 committed by Gerrit Code Review
commit 6ffb85b055
1 changed files with 9 additions and 0 deletions

View File

@ -16,8 +16,17 @@
# but pkg_resources can't be imported.
echo "import pkg_resources" | python3 2>/dev/null
has_py3=$?
echo "import pkg_resources" | python2 2>/dev/null
has_py2=$?
echo "import pkg_resources" | /usr/libexec/platform-python 2>/dev/null
has_platform-py=$?
if [ $has_py3 = 0 ]; then
interpreter="python3"
elif [ $has_py2 = 0 ]; then
interpreter="python"
elif [ $has_platform-py = 0 ]; then
interpreter="/usr/libexec/platform-python"
else
interpreter="python"
fi