From df6c0cef6e7de65f07d6527c22539c5d5b6db815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 16 Nov 2022 00:10:19 +0100 Subject: [PATCH] Don't set SETUPTOOLS_USE_DISTUTILS=stdlib when distutils does not exist Python 3.12.0a2 removed the standard library distutils module, so we can no longer use it. --- selftest/parallel.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/selftest/parallel.sh b/selftest/parallel.sh index 14b6e95..b59ea7c 100755 --- a/selftest/parallel.sh +++ b/selftest/parallel.sh @@ -26,7 +26,8 @@ export OPENSSL_CONF=/non-existing-file # setuptools 60+ uses its own copy of distutils by default # this setting must be overriden with the environment variable for # Python tests to use the standard library's distutils -export SETUPTOOLS_USE_DISTUTILS=stdlib +# We only do this if stdlib distutils actually exists +$PYTHON -c 'import distutils' 2>/dev/null && export SETUPTOOLS_USE_DISTUTILS=stdlib || true $PYTHON -m test.pythoninfo $PYTHON -m test -wW -j$JOBS $X