MCPcopy Index your code
hub / github.com/RustPython/RustPython / _check_for_unavailable_sdk

Function _check_for_unavailable_sdk

Lib/_osx_support.py:331–355  ·  view source on GitHub ↗

Remove references to any SDKs not available

(_config_vars)

Source from the content-addressed store, hash-verified

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