(str_ldpaths: str, path: str, root: str = "")
return [p for p in dedupe(ldpaths) if os.path.isdir(p)]
Parse the colon-delimited list of paths and apply ldso rules to each

    Note the special handling as dictated by the ldso:
    - Empty paths are equivalent to $PWD
    - $ORIGIN is expanded to the path of the given file
    - (TODO) $LIB and friends

    Parameters
    ----------
    str_ldpaths
        A colon-delimited string of paths
    root
        The path to prepend to all paths found
    path
        The object actively being parsed (used for $ORIGIN)

    Returns
    -------
        list of processed paths
Parse the colon-delimited list of paths and apply ldso rules to each
Parse the colon - delimited list of paths and apply ldso rules to each
def parse_ld_paths(str_ldpaths: str, path: str, root: str = "") -> List[str]:
    """Parse the colon-delimited list of paths and apply ldso rules to each

    Note the special handling as dictated by the ldso:
    - Empty paths are equivalent to $PWD
    - $ORIGIN is expanded to the path of the given file
    - (TODO) $LIB and friends

    Parameters
    ----------
    str_ldpaths
        A colon-delimited string of paths
    root
        The path to prepend to all paths found
    path
        The object actively being parsed (used for $ORIGIN)

    Returns
    -------
        list of processed paths
    """
    ldpaths = []  # type: List[str]
    for ldpath in str_ldpaths.split(":"):
        if ldpath == "":
            # The ldso treats "" paths as $PWD.
            ldpath = os.getcwd()
        elif "$ORIGIN" in ldpath:
            ldpath = ldpath.replace("$ORIGIN", os.path.dirname(os.path.abspath(path)))
        else:
            ldpath = root + ldpath
        ldpaths.append(normpath(ldpath))
    return [p for p in dedupe(ldpaths) if os.path.isdir(p)]
def parse_ld_paths ( str_ldpaths : str , path : str , root : str = "" ) -> List [ str ] : ldpaths = [ ] # type: List[str] for ldpath in str_ldpaths . split ( ":" ) : if ldpath == "" : # The ldso treats "" paths as $PWD. ldpath = os . getcwd ( ) elif "$ORIGIN" in ldpath : ldpath = ldpath . replace ( "$ORIGIN" , os . path . dirname ( os . path . abspath ( path ) ) ) else : ldpath = root + ldpath ldpaths . append ( normpath ( ldpath ) ) return [ p for p in dedupe ( ldpaths ) if os . path . isdir ( p ) ]