def patch_lib_paths(fname, library_dirs):
 if (sys.platform != 'darwin'):
  return
 libs = _get_libs(fname)
 for lib in libs:
  if (not lib.startswith(('@', '/'))):
   real_lib = _find_library(lib, library_dirs)
   if real_lib:
    _install_name_change(fname, lib, real_lib)

def patch_lib_paths ( fname , library_dirs ) : if ( sys . platform != 'darwin' ) : return libs = _get_libs ( fname ) for lib in libs : if ( not lib . startswith ( ( '@' , '/' ) ) ) : real_lib = _find_library ( lib , library_dirs ) if real_lib : _install_name_change ( fname , lib , real_lib )
load any weakly-defined libraries from their real location - find libraries with otool -l - update with install_name_tool -change .