Do not force SETUPTOOLS_USE_DISTUTILS=stdlib on Python 3.12+
(in non-PEP517 mode), as stdlib no longer supplies distutils there.
Thanks to Sam for the report!

Signed-off-by: Michał Górny <mgo...@gentoo.org>
---
 eclass/distutils-r1.eclass | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 0ccd59fb6c78..f3325d5bd8f4 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1814,9 +1814,11 @@ distutils-r1_run_phase() {
                # and _all() already localizes it
                local -x PATH=${PATH}
 
-               # Undo the default switch in setuptools-60+ for the time being,
-               # to avoid replacing .egg-info file with directory in-place.
-               local -x 
SETUPTOOLS_USE_DISTUTILS="${SETUPTOOLS_USE_DISTUTILS:-stdlib}"
+               if _python_impl_matches "${EPYTHON}" 3.{9..11}; then
+                       # Undo the default switch in setuptools-60+ for the 
time being,
+                       # to avoid replacing .egg-info file with directory 
in-place.
+                       local -x 
SETUPTOOLS_USE_DISTUTILS="${SETUPTOOLS_USE_DISTUTILS:-stdlib}"
+               fi
 
                # Bug 559644
                # using PYTHONPATH when the ${BUILD_DIR}/lib is not created yet 
might lead to
-- 
2.41.0


Reply via email to