diff --git a/Lib/distutils/command/config.py b/Lib/distutils/command/config.py index f511b888577..aeda408e731 100644 --- a/Lib/distutils/command/config.py +++ b/Lib/distutils/command/config.py @@ -328,7 +328,6 @@ class config(Command): return self.try_cpp(body="/* No body */", headers=[header], include_dirs=include_dirs) - def dump_file(filename, head=None): """Dumps a file content into log.info. diff --git a/Lib/distutils/tests/test_config_cmd.py b/Lib/distutils/tests/test_config_cmd.py index 6e566e79152..b735fd334d8 100644 --- a/Lib/distutils/tests/test_config_cmd.py +++ b/Lib/distutils/tests/test_config_cmd.py @@ -39,11 +39,17 @@ class ConfigTestCase(support.LoggingSilencer, @unittest.skipIf(sys.platform == 'win32', "can't test on Windows") def test_search_cpp(self): + import shutil cmd = missing_compiler_executable(['preprocessor']) if cmd is not None: self.skipTest('The %r command is not found' % cmd) pkg_dir, dist = self.create_dist() cmd = config(dist) + cmd._check_compiler() + compiler = cmd.compiler + is_xlc = shutil.which(compiler.preprocessor[0]).startswith("/usr/vac") + if is_xlc: + self.skipTest('xlc: The -E option overrides the -P, -o, and -qsyntaxonly options') # simple pattern searches match = cmd.search_cpp(pattern='xxx', body='/* xxx */') diff --git a/Misc/NEWS.d/next/Tests/2018-08-08-22-41-30.bpo-11191.eq9tSH.rst b/Misc/NEWS.d/next/Tests/2018-08-08-22-41-30.bpo-11191.eq9tSH.rst new file mode 100644 index 00000000000..d05d52238e0 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2018-08-08-22-41-30.bpo-11191.eq9tSH.rst @@ -0,0 +1,2 @@ +Skip the distutils test 'test_search_cpp' when using XLC as compiler +patch by aixtools (Michael Felt)