def expandpats(pats): if not util.expandglobs: return list(pats) ret = [] for p in pats: kind, name = matchmod._patsplit(p, None) if kind is None: try: globbed = glob.glob(name) except re.error: globbed = [name] if globbed: ret.extend(globbed) continue ret.append(p) return ret
def expandpats(pats): if not util.expandglobs: return list(pats) ret = [] for p in pats: kind, name = _match._patsplit(p, None) if kind is None: try: globbed = glob.glob(name) except re.error: globbed = [name] if globbed: ret.extend(globbed) continue ret.append(p) return ret
def expandpats(pats): '''Expand bare globs when running on windows. On posix we assume it already has already been done by sh.''' if not util.expandglobs: return list(pats) ret = [] for kindpat in pats: kind, pat = matchmod._patsplit(kindpat, None) if kind is None: try: globbed = glob.glob(pat) except re.error: globbed = [pat] if globbed: ret.extend(globbed) continue ret.append(kindpat) return ret