From b519af280b437b1d5580bc000fc5bcfefbcd0f16 Mon Sep 17 00:00:00 2001 From: Dave Page Date: Thu, 6 Oct 2022 12:43:03 +0100 Subject: [PATCH] Don't assume the system python executable is "python". Favour "python3" and fall back. --- pkg/mac/build-functions.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/mac/build-functions.sh b/pkg/mac/build-functions.sh index c56e02f9b..569ef41c1 100644 --- a/pkg/mac/build-functions.sh +++ b/pkg/mac/build-functions.sh @@ -74,8 +74,16 @@ _create_python_env() { PATH=${PGADMIN_POSTGRES_DIR}/bin:${PATH} LD_LIBRARY_PATH=${PGADMIN_POSTGRES_DIR}/lib:${LD_LIBRARY_PATH} + # Figure out what python to use + if which python3 > /dev/null 2>&1 + then + SYSTEM_PYTHON_EXE="python3" + else + SYSTEM_PYTHON_EXE="python" + fi + git clone https://github.com/gregneagle/relocatable-python.git "${BUILD_ROOT}/relocatable_python" - PATH=$PATH:/usr/local/pgsql/bin python \ + PATH=$PATH:/usr/local/pgsql/bin "${SYSTEM_PYTHON_EXE}" \ "${BUILD_ROOT}/relocatable_python/make_relocatable_python_framework.py" \ --upgrade-pip \ --python-version "${PGADMIN_PYTHON_VERSION}" \