summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2022-06-08 12:47:05 +0300
committerPanu Matilainen <pmatilai@redhat.com>2022-06-28 14:51:02 +0300
commitb8884ddcfb5af8d4b61f473661a4b1e2b60fa1e0 (patch)
tree5debee21469fb2dc493c044b1073242bc1297708
parent587996c901481edabae130fafa5ee299affa3959 (diff)
downloadrpm-b8884ddcfb5af8d4b61f473661a4b1e2b60fa1e0.tar.gz
Replace deprecated Python distutils use in test-suite setup
Get on with the times and use sysconfig instead of distutils for path configuration, eliminating deprecation warnings from running the test-suite. And in particular, on Fedora 36 distutils and sysconfig disagree on python prefix when not in rpm-build or virtualenv (whatever that means) causing all the python tests in our suite to fail due to not finding the in-tree bindings. (cherry picked from commit 4a0071c339083866dd8901e3ef449908488a9420)
-rw-r--r--tests/atlocal.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/atlocal.in b/tests/atlocal.in
index f968175cf..dae3f0a29 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -7,7 +7,7 @@ export PATH
PYTHON=@PYTHON@
if test "${PYTHON}"; then
- PYLIBDIR=$(${PYTHON} -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib(1,0,'@execprefix@'))")
+ PYLIBDIR=$(${PYTHON} -c "import sysconfig, sys; sys.stdout.write(sysconfig.get_path('platlib', vars={'platbase':'@execprefix@'}))")
PYTHONPATH="${abs_builddir}/testing${PYLIBDIR}"
export PYTHONPATH
fi