This is an archive of the discontinued Mercurial Phabricator instance.

py3: use list comprehensions instead of filter where we need to eagerly filter
ClosedPublic

Authored by durin42 on Feb 21 2018, 12:41 PM.

Details

Summary

These two uses of filter() are then checked for truthiness, but on Python 3:

bool(filter(None, []))

True

So we need to stop depending on that. Fortunately it's easy to replace
the filter with an equivalent list comprehension.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

durin42 created this revision.Feb 21 2018, 12:41 PM
pulkit accepted this revision.Feb 21 2018, 12:51 PM
indygreg accepted this revision.Feb 21 2018, 10:07 PM
This revision is now accepted and ready to land.Feb 21 2018, 10:07 PM
This revision was automatically updated to reflect the committed changes.