mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
python-utils-r1.eclass: Make python_optimize fail if -x $PYTHON
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 <mgorny@gentoo.org>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user