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