Description: tests: Mock CCompiler.call if available
 In newer setuptools distutils, CCompiler.spawn is deprecated and preprocess /
 compile methods invoke CCompiler.call directly. Mock 'call' when available
 so test commands are captured without attempting to run missing compilers/files.
Forwarded: no
--- a/tests/scanner/test_ccompiler.py
+++ b/tests/scanner/test_ccompiler.py
@@ -82,7 +82,8 @@
         except ImportError as e:
             raise unittest.SkipTest(e)
 
-        with patch.object(distutils.ccompiler.CCompiler, 'spawn') as spawn:
+        target = 'call' if hasattr(distutils.ccompiler.CCompiler, 'call') else 'spawn'
+        with patch.object(distutils.ccompiler.CCompiler, target) as spawn:
             with Environ(environ):
                 cc = CCompiler(compiler_name=compiler_name)
                 # Avoid check if target is newer from source.
@@ -103,7 +104,8 @@
         except ImportError as e:
             raise unittest.SkipTest(e)
 
-        with patch.object(distutils.ccompiler.CCompiler, 'spawn') as spawn:
+        target = 'call' if hasattr(distutils.ccompiler.CCompiler, 'call') else 'spawn'
+        with patch.object(distutils.ccompiler.CCompiler, target) as spawn:
             with Environ(environ):
                 cc = CCompiler(compiler_name=compiler_name)
                 # Avoid check if target is newer from source.
