From 62d56248dfed2b30deda4026cf3abe7eef385aec Mon Sep 17 00:00:00 2001 From: Enno Tensing Date: Thu, 7 Aug 2025 20:37:28 +0200 Subject: [PATCH] containerctl: Check if python3 is at least 3.11 Signed-off-by: Enno Tensing --- containerctl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/containerctl b/containerctl index 112bcad..b5710ca 100755 --- a/containerctl +++ b/containerctl @@ -106,7 +106,13 @@ generate_container() exit 1 fi - /usr/bin/env python3 "${BASEDIR}/generate/generate.py" \ + mypython="python3" + pyver="$(/usr/bin/env "${mypython}" -c 'import sys; print(sys.version_info.minor)')" + if [ "${pyver}" -gt "11" ] + then + mypython="python3.11" + fi + /usr/bin/env "${mypython}" "${BASEDIR}/generate/generate.py" \ "${CONFIGDIR}/${config}" "${LOG}" "${CONTAINERDIR}" if [ "${?}" = 1 ]