]> granicus.if.org Git - python/commitdiff
#4440: modernize a use of filter(), making it compatible with 3.x
authorAndrew M. Kuchling <amk@amk.ca>
Fri, 2 Apr 2010 16:59:16 +0000 (16:59 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Fri, 2 Apr 2010 16:59:16 +0000 (16:59 +0000)
Lib/pstats.py

index 6beb0b3bcfa270056187c11e9c35d7748ec24b68..0effa1c41c5394c013bf78279aafee97b14b8498 100644 (file)
@@ -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):"