python-utils-r1.eclass: Remove python_optimize support for py<3.5

Remove the support code for Python 2.7, <3.5, as well as PyPy2.7.  These
are no longer supported at runtime, so byte-compiling should not be used
for these impls.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2021-06-23 23:44:04 +02:00
parent 1c2d52b662
commit 964f5c6181
+2 -6
View File
@@ -625,18 +625,14 @@ 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 3.5
# both levels of optimization are separate since py3.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}"
;;
*)
"${PYTHON}" -m compileall -q -f -d "${instpath}" "${d}"
die "Unknown impl for python_optimize: ${EPYTHON}"
;;
esac
done