summaryrefslogtreecommitdiff
path: root/eclass/python-utils-r1.eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass/python-utils-r1.eclass')
-rw-r--r--eclass/python-utils-r1.eclass8
1 files changed, 3 insertions, 5 deletions
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index b61bf730b8c4..4fedd2b8a790 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -624,13 +624,11 @@ python_optimize() {
local jobs=$(makeopts_jobs)
local d
for d; do
- # make sure to get a nice path without //
- local instpath=${d#${D}}
- instpath=/${instpath##/}
-
einfo "Optimize Python modules for ${instpath}"
+ # NB: '-s' makes the path relative, so we need '-p /' to make it
+ # absolute again; https://github.com/python/cpython/issues/133503
"${PYTHON}" -m compileall -j "${jobs}" -o 0 -o 1 -o 2 \
- --hardlink-dupes -q -f -d "${instpath}" "${d}"
+ --hardlink-dupes -q -f -s "${D}" -p / "${d}"
done
}