summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2021-06-24 13:41:02 +0200
committerMichał Górny <mgorny@gentoo.org>2021-06-24 13:41:59 +0200
commit7fb83c87d07d9488fe6e7f9f79834ececad90790 (patch)
tree3e14c9f159dc8782cf533e9debb44ae5e99542eb
parentdev-python/google-api-core: Add mock dep (diff)
downloadgentoo-7fb83c87d07d9488fe6e7f9f79834ececad90790.tar.gz
gentoo-7fb83c87d07d9488fe6e7f9f79834ececad90790.tar.bz2
gentoo-7fb83c87d07d9488fe6e7f9f79834ececad90790.zip
python-utils-r1.eclass: Revert "Remove python_optimize support..."
python_optimize is still used in dev-python/pypy. Reverts: 964f5c61816659b0138c8fe98593786d9da7f084 Closes: https://bugs.gentoo.org/798330 Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r--eclass/python-utils-r1.eclass8
1 files changed, 6 insertions, 2 deletions
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index d43311762f9f..7488802332f6 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