From: Andrew M. Kuchling Date: Fri, 2 Apr 2010 16:59:16 +0000 (+0000) Subject: #4440: modernize a use of filter(), making it compatible with 3.x X-Git-Tag: v2.7b1~142 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d54e699cba4abab087bfd625a1fec8b6571ea042;p=python #4440: modernize a use of filter(), making it compatible with 3.x --- diff --git a/Lib/pstats.py b/Lib/pstats.py index 6beb0b3bcf..0effa1c41c 100644 --- a/Lib/pstats.py +++ b/Lib/pstats.py @@ -649,7 +649,7 @@ if __name__ == '__main__': def do_sort(self, line): abbrevs = self.stats.get_sort_arg_defs() - if line and not filter(lambda x,a=abbrevs: x not in a,line.split()): + if line and all((x in abbrevs) for x in line.split()): self.stats.sort_stats(*line.split()) else: print >> self.stream, "Valid sort keys (unique prefixes are accepted):"