Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def repath_lib(lib_fname, old_path, new_path):
install_id = get_install_id(lib_fname)
L = len(old_path)
if install_id and install_id.startswith(old_path):
set_install_id(lib_fname, new_path + install_id[L:])
for name in get_install_names(lib_fname):
if name.startswith(old_path):
set_install_name(lib_fname, name, new_path + name[L:])