From 31e299c08f250b126b2c2c0ecce12ee563b70fdc Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Thu, 10 Jun 2021 18:50:55 +0200 Subject: [PATCH] patch 8.2.2970: Python configure check uses deprecated command Problem: Python configure check uses deprecated command. Solution: Use sysconfig instead of distutils if possible. (Zdenek Dohnal, closes #8354) --- src/auto/configure | 5 ++++- src/configure.ac | 5 ++++- src/version.c | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/auto/configure b/src/auto/configure index 5702a2171..7ecc40ca5 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -6755,7 +6755,10 @@ else vi_cv_path_python3_conf= config_dir="config-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" - d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"` + d=`${vi_cv_path_python3} -c "import sysconfig; print(sysconfig.get_config_var('LIBPL'))" 2> /dev/null` + if test "x$d" = "x"; then + d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"` + fi if test -d "$d" && test -f "$d/config.c"; then vi_cv_path_python3_conf="$d" else diff --git a/src/configure.ac b/src/configure.ac index 2db04496f..9810ea1fc 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -1487,7 +1487,10 @@ if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic"; [ vi_cv_path_python3_conf= config_dir="config-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" - d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"` + d=`${vi_cv_path_python3} -c "import sysconfig; print(sysconfig.get_config_var('LIBPL'))" 2> /dev/null` + if test "x$d" = "x"; then + d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"` + fi if test -d "$d" && test -f "$d/config.c"; then vi_cv_path_python3_conf="$d" else 2.31.1