From: Lysandros Nikolaou Date: Fri, 13 Oct 2023 08:52:30 +0000 (+0200) Subject: gh-106212: Raise when using c-analyzer with clang on darwin (#110757) X-Git-Tag: v3.13.0a2~485^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=898f531996f2c5399b13811682c578c4fd08afaa;p=thirdparty%2FPython%2Fcpython.git gh-106212: Raise when using c-analyzer with clang on darwin (#110757) --- diff --git a/Tools/c-analyzer/c_parser/preprocessor/__init__.py b/Tools/c-analyzer/c_parser/preprocessor/__init__.py index cdc1a4e12690..30a86cbd7dc4 100644 --- a/Tools/c-analyzer/c_parser/preprocessor/__init__.py +++ b/Tools/c-analyzer/c_parser/preprocessor/__init__.py @@ -2,6 +2,7 @@ import contextlib import logging import os import os.path +import platform import re import sys @@ -242,6 +243,8 @@ def _get_default_compiler(): return 'unix' if os.name == 'nt': return 'msvc' + if sys.platform == 'darwin' and 'clang' in platform.python_compiler(): + return 'clang' return 'unix'