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

Function walk_stack

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

Walk a stack yielding the frame and line number for each frame. This will follow f.f_back from the given frame. If no frame is given, the current stack is used. Usually used with StackSummary.extract.

(f)

Source from the content-addressed store, hash-verified

320
321
322def walk_stack(f):
323 """Walk a stack yielding the frame and line number for each frame.
324
325 This will follow f.f_back from the given frame. If no frame is given, the
326 current stack is used. Usually used with StackSummary.extract.
327 """
328 if f is None:
329 f = sys._getframe().f_back.f_back.f_back.f_back
330 while f is not None:
331 yield f, f.f_lineno
332 f = f.f_back
333
334
335def walk_tb(tb):

Callers 1

extract_stackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected