diff --git a/lib/functions.sh b/lib/functions.sh index 89716e7700..9e482b2e29 100644 --- a/lib/functions.sh +++ b/lib/functions.sh @@ -2877,13 +2877,20 @@ python_vendor_relocate() { python_compile() { logmsg "Compiling python modules" - logcmd $PYTHON \ - -m compileall \ - -j0 \ - -f \ - --invalidation-mode timestamp \ - "$@" \ - $DESTDIR + case $PYTHONVER in + 2.*) logcmd $PYTHON \ + -m compileall \ + -f \ + "$@" \ + $DESTDIR ;; + *) logcmd $PYTHON \ + -m compileall \ + -j0 \ + -f \ + --invalidation-mode timestamp \ + "$@" \ + $DESTDIR ;; + esac } python_pep518() {