Mercurial > cpython-lru_cache-weakref
annotate Tools/scripts/objgraph.py @ 24042:63fbbed10714 legacy-trunk
Simplify HTTPSConnection constructor.
See discussion in SF bug 458463.
| author | Jeremy Hylton <jeremy@alum.mit.edu> |
|---|---|
| date | Fri, 28 Jun 2002 23:38:14 +0000 |
| parents | 14a27acc755a |
| children | 8a7a2f1f88f0 |
| rev | line source |
|---|---|
|
4573
73758db2f464
/usr/local/bin/python -> /usr/bin/env python
Guido van Rossum <guido@python.org>
parents:
1105
diff
changeset
|
1 #! /usr/bin/env python |
| 274 | 2 |
| 3 # objgraph | |
| 4 # | |
| 5 # Read "nm -o" input (on IRIX: "nm -Bo") of a set of libraries or modules | |
| 6 # and print various interesting listings, such as: | |
| 7 # | |
| 8 # - which names are used but not defined in the set (and used where), | |
| 9 # - which names are defined in the set (and where), | |
| 10 # - which modules use which other modules, | |
| 11 # - which modules are used by which other modules. | |
| 12 # | |
| 13 # Usage: objgraph [-cdu] [file] ... | |
| 14 # -c: print callers per objectfile | |
| 15 # -d: print callees per objectfile | |
| 16 # -u: print usage of undefined symbols | |
| 17 # If none of -cdu is specified, all are assumed. | |
| 18 # Use "nm -o" to generate the input (on IRIX: "nm -Bo"), | |
| 19 # e.g.: nm -o /lib/libc.a | objgraph | |
| 20 | |
| 21 | |
| 22 import sys | |
| 23 import string | |
|
1105
6f2a6efd019e
Adapt to modern times...
Guido van Rossum <guido@python.org>
parents:
559
diff
changeset
|
24 import os |
| 274 | 25 import getopt |
|
1105
6f2a6efd019e
Adapt to modern times...
Guido van Rossum <guido@python.org>
parents:
559
diff
changeset
|
26 import regex |
| 274 | 27 |
| 28 # Types of symbols. | |
| 29 # | |
| 30 definitions = 'TRGDSBAEC' | |
| 31 externals = 'UV' | |
| 32 ignore = 'Nntrgdsbavuc' | |
| 33 | |
| 34 # Regular expression to parse "nm -o" output. | |
| 35 # | |
|
1105
6f2a6efd019e
Adapt to modern times...
Guido van Rossum <guido@python.org>
parents:
559
diff
changeset
|
36 matcher = regex.compile('\(.*\):\t?........ \(.\) \(.*\)$') |
| 274 | 37 |
| 38 # Store "item" in "dict" under "key". | |
| 39 # The dictionary maps keys to lists of items. | |
| 40 # If there is no list for the key yet, it is created. | |
| 41 # | |
| 42 def store(dict, key, item): | |
|
15930
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
43 if dict.has_key(key): |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
44 dict[key].append(item) |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
45 else: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
46 dict[key] = [item] |
| 274 | 47 |
| 48 # Return a flattened version of a list of strings: the concatenation | |
| 49 # of its elements with intervening spaces. | |
| 50 # | |
| 51 def flat(list): | |
|
15930
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
52 s = '' |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
53 for item in list: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
54 s = s + ' ' + item |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
55 return s[1:] |
| 274 | 56 |
| 57 # Global variables mapping defined/undefined names to files and back. | |
| 58 # | |
| 59 file2undef = {} | |
| 60 def2file = {} | |
| 61 file2def = {} | |
| 62 undef2file = {} | |
| 63 | |
| 64 # Read one input file and merge the data into the tables. | |
| 65 # Argument is an open file. | |
| 66 # | |
| 67 def readinput(file): | |
|
15930
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
68 while 1: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
69 s = file.readline() |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
70 if not s: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
71 break |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
72 # If you get any output from this line, |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
73 # it is probably caused by an unexpected input line: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
74 if matcher.search(s) < 0: s; continue # Shouldn't happen |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
75 (ra, rb), (r1a, r1b), (r2a, r2b), (r3a, r3b) = matcher.regs[:4] |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
76 fn, name, type = s[r1a:r1b], s[r3a:r3b], s[r2a:r2b] |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
77 if type in definitions: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
78 store(def2file, name, fn) |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
79 store(file2def, fn, name) |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
80 elif type in externals: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
81 store(file2undef, fn, name) |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
82 store(undef2file, name, fn) |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
83 elif not type in ignore: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
84 print fn + ':' + name + ': unknown type ' + type |
| 274 | 85 |
| 86 # Print all names that were undefined in some module and where they are | |
| 87 # defined. | |
| 88 # | |
| 89 def printcallee(): | |
|
15930
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
90 flist = file2undef.keys() |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
91 flist.sort() |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
92 for file in flist: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
93 print file + ':' |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
94 elist = file2undef[file] |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
95 elist.sort() |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
96 for ext in elist: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
97 if len(ext) >= 8: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
98 tabs = '\t' |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
99 else: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
100 tabs = '\t\t' |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
101 if not def2file.has_key(ext): |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
102 print '\t' + ext + tabs + ' *undefined' |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
103 else: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
104 print '\t' + ext + tabs + flat(def2file[ext]) |
| 274 | 105 |
| 106 # Print for each module the names of the other modules that use it. | |
| 107 # | |
| 108 def printcaller(): | |
|
15930
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
109 files = file2def.keys() |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
110 files.sort() |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
111 for file in files: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
112 callers = [] |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
113 for label in file2def[file]: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
114 if undef2file.has_key(label): |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
115 callers = callers + undef2file[label] |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
116 if callers: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
117 callers.sort() |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
118 print file + ':' |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
119 lastfn = '' |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
120 for fn in callers: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
121 if fn <> lastfn: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
122 print '\t' + fn |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
123 lastfn = fn |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
124 else: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
125 print file + ': unused' |
| 274 | 126 |
| 127 # Print undefine names and where they are used. | |
| 128 # | |
| 129 def printundef(): | |
|
15930
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
130 undefs = {} |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
131 for file in file2undef.keys(): |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
132 for ext in file2undef[file]: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
133 if not def2file.has_key(ext): |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
134 store(undefs, ext, file) |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
135 elist = undefs.keys() |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
136 elist.sort() |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
137 for ext in elist: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
138 print ext + ':' |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
139 flist = undefs[ext] |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
140 flist.sort() |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
141 for file in flist: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
142 print '\t' + file |
| 274 | 143 |
| 144 # Print warning messages about names defined in more than one file. | |
| 145 # | |
| 146 def warndups(): | |
|
15930
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
147 savestdout = sys.stdout |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
148 sys.stdout = sys.stderr |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
149 names = def2file.keys() |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
150 names.sort() |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
151 for name in names: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
152 if len(def2file[name]) > 1: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
153 print 'warning:', name, 'multiply defined:', |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
154 print flat(def2file[name]) |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
155 sys.stdout = savestdout |
| 274 | 156 |
| 157 # Main program | |
| 158 # | |
| 159 def main(): | |
|
15930
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
160 try: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
161 optlist, args = getopt.getopt(sys.argv[1:], 'cdu') |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
162 except getopt.error: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
163 sys.stdout = sys.stderr |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
164 print 'Usage:', os.path.basename(sys.argv[0]), |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
165 print '[-cdu] [file] ...' |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
166 print '-c: print callers per objectfile' |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
167 print '-d: print callees per objectfile' |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
168 print '-u: print usage of undefined symbols' |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
169 print 'If none of -cdu is specified, all are assumed.' |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
170 print 'Use "nm -o" to generate the input (on IRIX: "nm -Bo"),' |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
171 print 'e.g.: nm -o /lib/libc.a | objgraph' |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
172 return 1 |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
173 optu = optc = optd = 0 |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
174 for opt, void in optlist: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
175 if opt == '-u': |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
176 optu = 1 |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
177 elif opt == '-c': |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
178 optc = 1 |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
179 elif opt == '-d': |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
180 optd = 1 |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
181 if optu == optc == optd == 0: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
182 optu = optc = optd = 1 |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
183 if not args: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
184 args = ['-'] |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
185 for file in args: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
186 if file == '-': |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
187 readinput(sys.stdin) |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
188 else: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
189 readinput(open(file, 'r')) |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
190 # |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
191 warndups() |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
192 # |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
193 more = (optu + optc + optd > 1) |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
194 if optd: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
195 if more: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
196 print '---------------All callees------------------' |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
197 printcallee() |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
198 if optu: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
199 if more: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
200 print '---------------Undefined callees------------' |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
201 printundef() |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
202 if optc: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
203 if more: |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
204 print '---------------All Callers------------------' |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
205 printcaller() |
|
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
206 return 0 |
| 274 | 207 |
| 208 # Call the main program. | |
| 209 # Use its return value as exit status. | |
| 210 # Catch interrupts to avoid stack trace. | |
| 211 # | |
| 212 try: | |
|
15930
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
213 sys.exit(main()) |
| 274 | 214 except KeyboardInterrupt: |
|
15930
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
4573
diff
changeset
|
215 sys.exit(1) |
