Mercurial > hg
diff hgext/narrow/narrowchangegroup.py @ 36345:f85e32a5e5c8
narrow: use list comprehension instead of filter for filtering lists
filter() returns a generator on Python 3, which causes these filters
to break things.
Differential Revision: https://phab.mercurial-scm.org/D2363
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 21 Feb 2018 10:08:35 -0500 |
parents | 9445a3141501 |
children | ff7a19ad7aa3 |
line wrap: on
line diff
--- a/hgext/narrow/narrowchangegroup.py Wed Feb 21 09:43:35 2018 -0500 +++ b/hgext/narrow/narrowchangegroup.py Wed Feb 21 10:08:35 2018 -0500 @@ -52,7 +52,7 @@ getattr(self, '_narrow_matcher', None)) if matcher is not None: narrowmatch = matcher() - changedfiles = filter(narrowmatch, changedfiles) + changedfiles = [f for f in changedfiles if narrowmatch(f)] if getattr(self, 'is_shallow', False): # See comment in generate() for why this sadness is a thing. mfdicts = self._mfdicts