forked from fedora-python/python26
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython-2.6.6-cprofile-sort-option.patch
More file actions
23 lines (21 loc) · 1.02 KB
/
python-2.6.6-cprofile-sort-option.patch
File metadata and controls
23 lines (21 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
diff -up Python-2.6.6/Lib/cProfile.py.sort Python-2.6.6/Lib/cProfile.py
--- Python-2.6.6/Lib/cProfile.py.sort 2015-02-09 12:45:46.525657065 +0100
+++ Python-2.6.6/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,7 +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()