diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index d43311762f9fc..7488802332f6a 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -597,14 +597,18 @@ python_optimize() { instpath=/${instpath##/} case "${EPYTHON}" in + python2.7|python3.[34]) + "${PYTHON}" -m compileall -q -f -d "${instpath}" "${d}" + "${PYTHON}" -OO -m compileall -q -f -d "${instpath}" "${d}" + ;; python*|pypy3) - # both levels of optimization are separate since py3.5 + # both levels of optimization are separate since 3.5 "${PYTHON}" -m compileall -q -f -d "${instpath}" "${d}" "${PYTHON}" -O -m compileall -q -f -d "${instpath}" "${d}" "${PYTHON}" -OO -m compileall -q -f -d "${instpath}" "${d}" ;; *) - die "Unknown impl for python_optimize: ${EPYTHON}" + "${PYTHON}" -m compileall -q -f -d "${instpath}" "${d}" ;; esac done