@@ -43,7 +43,7 @@ if [ -n "${SBINDIR:-}" ] ; then
PATH="$DESTDIR$SBINDIR:$PATH"
fi
-NEW_PYTHONPATH="$DESTDIR$(${PYTHON:-python3} -c "from distutils.sysconfig import *;print(get_python_lib(plat_specific=1, prefix='/usr'))"):$DESTDIR$(${PYTHON:-python3} -c "from distutils.sysconfig import *;print(get_python_lib(prefix='/usr'))")"
+NEW_PYTHONPATH="$DESTDIR$(${PYTHON:-python3} -c "import sysconfig; print(sysconfig.get_path('platlib', vars={'platbase': '/usr', 'base': '/usr'}))"):$DESTDIR$(${PYTHON:-python3} -c "import sysconfig; print(sysconfig.get_path('purelib', vars={'platbase': '/usr', 'base': '/usr'}))")"
if [ -n "${PYTHONPATH:-}" ] ; then
# Prefix the PYTHONPATH with the new directories
export PYTHONPATH="$NEW_PYTHONPATH:$PYTHONPATH"
@@ -21,7 +21,7 @@ fi
# Make sure to use the newly-installed libraries when running tests
export LD_LIBRARY_PATH="$DESTDIR/usr/lib:$DESTDIR/lib"
export PATH="$DESTDIR/usr/sbin:$DESTDIR/usr/bin:$DESTDIR/sbin:$DESTDIR/bin:$PATH"
-export PYTHONPATH="$DESTDIR$(${PYTHON:-python3} -c "from distutils.sysconfig import *;print(get_python_lib(prefix='/usr'))")"
+export PYTHONPATH="$DESTDIR$(${PYTHON:-python3} -c "import sysconfig; print(sysconfig.get_path('purelib', vars={'platbase': '/usr', 'base': '/usr'}))")"
export RUBYLIB="$DESTDIR/$(${RUBY:-ruby} -e 'puts RbConfig::CONFIG["vendorlibdir"]'):$DESTDIR/$(${RUBY:-ruby} -e 'puts RbConfig::CONFIG["vendorarchdir"]')"
if [ -f /etc/debian_version ] && [ -z "${IS_CIRCLE_CI:-}" ] ; then
The distutils package is deprecated and scheduled to be removed in Python 3.12. Use the sysconfig module instead. Signed-off-by: James Carter <jwcart2@gmail.com> --- scripts/env_use_destdir | 2 +- scripts/run-scan-build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)