An interpreted, interactive, object-oriented programming language
CentOS Sources
2017-08-01 71084d584ff953f5463757ec6536406320560b4d
commit | author | age
f63228 1 diff -up Python-2.7.5/Lib/cProfile.py.sort Python-2.7.5/Lib/cProfile.py
CS 2 --- Python-2.7.5/Lib/cProfile.py.sort    2015-02-09 12:45:46.525657065 +0100
3 +++ Python-2.7.5/Lib/cProfile.py    2015-02-09 12:45:05.266316315 +0100
4 @@ -161,7 +161,7 @@ def label(code):
5  # ____________________________________________________________
6  
7  def main():
8 -    import os, sys
9 +    import os, pstats, sys
10      from optparse import OptionParser
11      usage = "cProfile.py [-o output_file_path] [-s sort] scriptfile [arg] ..."
12      parser = OptionParser(usage=usage)
13 @@ -169,8 +169,9 @@ def main():
14      parser.add_option('-o', '--outfile', dest="outfile",
15          help="Save stats to <outfile>", default=None)
16      parser.add_option('-s', '--sort', dest="sort",
17 -        help="Sort order when printing to stdout, based on pstats.Stats class",
18 -        default=-1)
19 +        help="Sort order when printing to stdout, based on pstats.Stats class",
20 +        default=-1,
21 +        choices=pstats.Stats.sort_arg_dict_default.keys())
22  
23      if not sys.argv[1:]:
24          parser.print_usage()
25