From f58ec7afec183fb7c40fcc28e6db269988c1f762 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Thu, 17 Sep 2020 15:57:52 +0200 Subject: python-utils-r1.eclass: Make python_optimize fail if -x $PYTHON MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make python_optimize() fail if the expected Python interpreter is not executable. Since some errors are expected during Python byte-compilation (e.g. CPython includes test .py modules with syntax errors), we can't rely on compileall result. However, this will catch at least the very bad mistake of wrong ${PYTHON} that affects e.g. dev-python/pypy*. Signed-off-by: Michał Górny --- eclass/python-utils-r1.eclass | 1 + 1 file changed, 1 insertion(+) (limited to 'eclass') diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index 87cb662c64fd..9c8b6a14d2ac 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -608,6 +608,7 @@ python_optimize() { local PYTHON=${PYTHON} [[ ${PYTHON} ]] || _python_export PYTHON + [[ -x ${PYTHON} ]] || die "PYTHON (${PYTHON}) is not executable" # default to sys.path if [[ ${#} -eq 0 ]]; then -- cgit v1.2.3-65-gdbad