From 0cf415842f7997dea63d7739c2d598f0f64d6d29 Mon Sep 17 00:00:00 2001 From: Andy Fiddaman Date: Sat, 23 Dec 2023 12:54:46 +0000 Subject: [PATCH] Fix python module compilation with Python 2.7 --- lib/functions.sh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) 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() {