From: Victor Stinner Date: Fri, 25 Apr 2025 09:50:55 +0000 (+0200) Subject: gh-132415: Use shutil.which() in missing_compiler_executable() (#132906) X-Git-Tag: v3.14.0b1~299 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=de6482eda3a46cc9c9a03fb9ba57295ab99b4722;p=thirdparty%2FPython%2Fcpython.git gh-132415: Use shutil.which() in missing_compiler_executable() (#132906) Replace deprecated distutils.spawn.find_executable() with shutil.which() in missing_compiler_executable() of test.support. --- diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 71820a20d50e..146cbaaf4cb8 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -1940,8 +1940,9 @@ def missing_compiler_executable(cmd_names=[]): missing. """ - from setuptools._distutils import ccompiler, sysconfig, spawn + from setuptools._distutils import ccompiler, sysconfig from setuptools import errors + import shutil compiler = ccompiler.new_compiler() sysconfig.customize_compiler(compiler) @@ -1960,7 +1961,7 @@ def missing_compiler_executable(cmd_names=[]): "the '%s' executable is not configured" % name elif not cmd: continue - if spawn.find_executable(cmd[0]) is None: + if shutil.which(cmd[0]) is None: return cmd[0]