docs: def _getImports_macholib(pth):
      """
      Find the binary dependencies of PTH.
  
      This implementation is for Mac OS X and uses library macholib.
      """
      from PyInstaller.lib.macholib.MachO import MachO
      from PyInstaller.lib.macholib.dyld import dyld_find
      rslt = set()
      seen = set()  # Libraries read from binary headers.
      # Walk through mach binary headers.
      m = MachO(pth)
      for header in m.headers:
          for idx, name, lib in header.walkRelocatables():
              # Sometimes some libraries are present multiple times.
              if lib not in seen:
                  seen.add(lib)
  
      ## Try to find files in file system.
  
      # In cases with @loader_path or @executable_path
      # try to look in the same directory as the checked binary is.
      # This seems to work in most cases.
      exec_path = os.path.abspath(os.path.dirname(pth))
  
      for lib in seen:
          if lib.startswith('@loader_path'):
              # macholib can't handle @loader_path. It has to be
              # handled the same way as @executable_path.
              # It is also replaced by 'exec_path'.
              lib = lib.replace('@loader_path', '@executable_path')
          try:
              lib = dyld_find(lib, executable_path=exec_path)
              rslt.add(lib)
          except ValueError:
              logger.error('Can not find path %s (needed by %s)', lib, pth)
  
      return rslt