mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-116869: Fix test_cext on RHEL7 (#117010)
Remove -std option from CC command line. Skip C++14 test for now on non-Windows platforms (like RHEL7).
This commit is contained in:
parent
2d17309cc7
commit
438de10c16
3 changed files with 30 additions and 20 deletions
|
@ -39,19 +39,22 @@ def main():
|
|||
if std:
|
||||
if support.MS_WINDOWS:
|
||||
cflags.append(f'/std:{std}')
|
||||
std_prefix = '/std'
|
||||
else:
|
||||
cflags.append(f'-std={std}')
|
||||
std_prefix = '-std'
|
||||
|
||||
# Remove existing -std options to only test ours
|
||||
cmd = (sysconfig.get_config_var('CC') or '')
|
||||
if cmd is not None:
|
||||
cmd = shlex.split(cmd)
|
||||
cmd = [arg for arg in cmd if not arg.startswith(std_prefix)]
|
||||
cmd = shlex.join(cmd)
|
||||
# CC env var overrides sysconfig CC variable in setuptools
|
||||
os.environ['CC'] = cmd
|
||||
# Remove existing -std or /std options from CC command line.
|
||||
# Python adds -std=c11 option.
|
||||
cmd = (sysconfig.get_config_var('CC') or '')
|
||||
if cmd is not None:
|
||||
if support.MS_WINDOWS:
|
||||
std_prefix = '/std'
|
||||
else:
|
||||
std_prefix = '-std'
|
||||
cmd = shlex.split(cmd)
|
||||
cmd = [arg for arg in cmd if not arg.startswith(std_prefix)]
|
||||
cmd = shlex.join(cmd)
|
||||
# CC env var overrides sysconfig CC variable in setuptools
|
||||
os.environ['CC'] = cmd
|
||||
|
||||
# Define Py_LIMITED_API macro
|
||||
if limited:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue