(_config_vars)
return _config_vars
Remove references to any SDKs not available
Remove references to any SDKs not available
Remove references to any SDKs not available
def _check_for_unavailable_sdk(_config_vars):
    """Remove references to any SDKs not available"""
    # If we're on OSX 10.5 or later and the user tries to
    # compile an extension using an SDK that is not present
    # on the current machine it is better to not use an SDK
    # than to fail.  This is particularly important with
    # the standalone Command Line Tools alternative to a
    # full-blown Xcode install since the CLT packages do not
    # provide SDKs.  If the SDK is not present, it is assumed
    # that the header files and dev libs have been installed
    # to /usr and /System/Library by either a standalone CLT
    # package or the CLT component within Xcode.
    cflags = _config_vars.get('CFLAGS', '')
    m = re.search(r'-isysroot\s*(\S+)', cflags)
    if m is not None:
        sdk = m.group(1)
        if not os.path.exists(sdk):
            for cv in _UNIVERSAL_CONFIG_VARS:
                # Do not alter a config var explicitly overridden by env var
                if cv in _config_vars and cv not in os.environ:
                    flags = _config_vars[cv]
                    flags = re.sub(r'-isysroot\s*\S+(?:\s|$)', ' ', flags)
                    _save_modified_value(_config_vars, cv, flags)

    return _config_vars
def _check_for_unavailable_sdk ( _config_vars ) : # If we're on OSX 10.5 or later and the user tries to # compile an extension using an SDK that is not present # on the current machine it is better to not use an SDK # than to fail.  This is particularly important with # the standalone Command Line Tools alternative to a # full-blown Xcode install since the CLT packages do not # provide SDKs.  If the SDK is not present, it is assumed # that the header files and dev libs have been installed # to /usr and /System/Library by either a standalone CLT # package or the CLT component within Xcode. cflags = _config_vars . get ( 'CFLAGS' , '' ) m = re . search ( r'-isysroot\s*(\S+)' , cflags ) if m is not None : sdk = m . group ( 1 ) if not os . path . exists ( sdk ) : for cv in _UNIVERSAL_CONFIG_VARS : # Do not alter a config var explicitly overridden by env var if cv in _config_vars and cv not in os . environ : flags = _config_vars [ cv ] flags = re . sub ( r'-isysroot\s*\S+(?:\s|$)' , ' ' , flags ) _save_modified_value ( _config_vars , cv , flags ) return _config_vars