python-utils-r1.eclass: Revert "Remove python_optimize support..."

python_optimize is still used in dev-python/pypy.

Reverts: 964f5c6181
Closes: https://bugs.gentoo.org/798330
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2021-06-24 13:41:59 +02:00
parent 9ff53a6d26
commit 7fb83c87d0
+6 -2
View File
@@ -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