Index: Lib/pstats.py =================================================================== --- Lib/pstats.py (revision 67391) +++ Lib/pstats.py (working copy) @@ -648,7 +648,7 @@ 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 not list(filter(lambda x,a=abbrevs: x not in a,line.split())): self.stats.sort_stats(*line.split()) else: print("Valid sort keys (unique prefixes are accepted):", file=self.stream)