Fixes py3 build by replacing silly use of filter with list comp