MCPcopy Index your code
hub / github.com/python/cpython / _check_for_unavailable_sdk

Function _check_for_unavailable_sdk

Lib/_osx_support.py:332–356  ·  view source on GitHub ↗

Remove references to any SDKs not available

(_config_vars)

Source from the content-addressed store, hash-verified

330
331
332def _check_for_unavailable_sdk(_config_vars):
333 """Remove references to any SDKs not available"""
334 # If we're on OSX 10.5 or later and the user tries to
335 # compile an extension using an SDK that is not present
336 # on the current machine it is better to not use an SDK
337 # than to fail. This is particularly important with
338 # the standalone Command Line Tools alternative to a
339 # full-blown Xcode install since the CLT packages do not
340 # provide SDKs. If the SDK is not present, it is assumed
341 # that the header files and dev libs have been installed
342 # to /usr and /System/Library by either a standalone CLT
343 # package or the CLT component within Xcode.
344 cflags = _config_vars.get('CFLAGS', '')
345 m = re.search(r'-isysroot\s*(\S+)', cflags)
346 if m is not None:
347 sdk = m.group(1)
348 if not os.path.exists(sdk):
349 for cv in _UNIVERSAL_CONFIG_VARS:
350 # Do not alter a config var explicitly overridden by env var
351 if cv in _config_vars and cv not in os.environ:
352 flags = _config_vars[cv]
353 flags = re.sub(r'-isysroot\s*\S+(?:\s|$)', ' ', flags)
354 _save_modified_value(_config_vars, cv, flags)
355
356 return _config_vars
357
358
359def compiler_fixup(compiler_so, cc_args):

Callers 1

customize_config_varsFunction · 0.85

Calls 6

_save_modified_valueFunction · 0.85
getMethod · 0.45
searchMethod · 0.45
groupMethod · 0.45
existsMethod · 0.45
subMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…