MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / extract_stack

Function extract_stack

tools/python-3.11.9-amd64/Lib/traceback.py:217–230  ·  view source on GitHub ↗

Extract the raw traceback from the current stack frame. The return value has the same format as for extract_tb(). The optional 'f' and 'limit' arguments have the same meaning as for print_stack(). Each item in the list is a quadruple (filename, line number, function name, tex

(f=None, limit=None)

Source from the content-addressed store, hash-verified

215
216
217def extract_stack(f=None, limit=None):
218 """Extract the raw traceback from the current stack frame.
219
220 The return value has the same format as for extract_tb(). The
221 optional 'f' and 'limit' arguments have the same meaning as for
222 print_stack(). Each item in the list is a quadruple (filename,
223 line number, function name, text), and the entries are in order
224 from oldest to newest stack frame.
225 """
226 if f is None:
227 f = sys._getframe().f_back
228 stack = StackSummary.extract(walk_stack(f), limit=limit)
229 stack.reverse()
230 return stack
231
232
233def clear_frames(tb):

Callers 2

print_stackFunction · 0.70
format_stackFunction · 0.70

Calls 3

walk_stackFunction · 0.85
extractMethod · 0.45
reverseMethod · 0.45

Tested by

no test coverage detected