diff -r bf3a7373e11a Lib/cProfile.py --- a/Lib/cProfile.py Sat Dec 05 00:19:08 2015 -0600 +++ b/Lib/cProfile.py Sat Dec 05 16:07:25 2015 +0800 @@ -39,7 +39,10 @@ def print_stats(self, sort=-1): import pstats - pstats.Stats(self).strip_dirs().sort_stats(sort).print_stats() + if hasattr(sort, '__iter__') and not isinstance(sort, str): + pstats.Stats(self).strip_dirs().sort_stats(*sort).print_stats() + else: + pstats.Stats(self).strip_dirs().sort_stats(sort).print_stats() def dump_stats(self, file): import marshal diff -r bf3a7373e11a Lib/profile.py --- a/Lib/profile.py Sat Dec 05 00:19:08 2015 -0600 +++ b/Lib/profile.py Sat Dec 05 16:07:25 2015 +0800 @@ -387,8 +387,10 @@ def print_stats(self, sort=-1): import pstats - pstats.Stats(self).strip_dirs().sort_stats(sort). \ - print_stats() + if hasattr(sort, '__iter__') and not isinstance(sort, str): + pstats.Stats(self).strip_dirs().sort_stats(*sort).print_stats() + else: + pstats.Stats(self).strip_dirs().sort_stats(sort).print_stats() def dump_stats(self, file): with open(file, 'wb') as f: