(filename, libname)
Find a dylib using dyld semantics
Find a dylib using dyld semantics
Find a dylib using dyld semantics
def dyld_library(filename, libname):
    """Find a dylib using dyld semantics"""
    filename = ensure_unicode(filename)
    libname = ensure_unicode(libname)
    def _search():
        spath = ensure_unicode(os.environ.get('DYLD_LIBRARY_PATH', None))
        if spath is not None:
            for path in spath.split(':'):
                yield os.path.join(path, libname)
        yield filename
        spath = ensure_unicode(os.environ.get(
            'DYLD_FALLBACK_LIBRARY_PATH', DEFAULT_LIBRARY_FALLBACK
        ))
        for path in spath.split(':'):
            yield os.path.join(path, libname)
    for f in inject_suffixes(_search()):
        if os.path.exists(f):
            return f
    raise ValueError("dylib %s could not be found" %(filename,))
def dyld_library ( filename , libname ) : filename = ensure_unicode ( filename ) libname = ensure_unicode ( libname ) def _search ( ) : spath = ensure_unicode ( os . environ . get ( 'DYLD_LIBRARY_PATH' , None ) ) if spath is not None : for path in spath . split ( ':' ) : yield os . path . join ( path , libname ) yield filename spath = ensure_unicode ( os . environ . get ( 'DYLD_FALLBACK_LIBRARY_PATH' , DEFAULT_LIBRARY_FALLBACK ) ) for path in spath . split ( ':' ) : yield os . path . join ( path , libname ) for f in inject_suffixes ( _search ( ) ) : if os . path . exists ( f ) : return f raise ValueError ( "dylib %s could not be found" % ( filename , ) )