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

Function getouterframes

tools/python-3.11.9-amd64/Lib/inspect.py:1719–1730  ·  view source on GitHub ↗

Get a list of records for a frame and all higher (calling) frames. Each record contains a frame object, filename, line number, function name, a list of lines of context, and index within the context.

(frame, context=1)

Source from the content-addressed store, hash-verified

1717 self.code_context, self.index, self.positions))
1718
1719def getouterframes(frame, context=1):
1720 """Get a list of records for a frame and all higher (calling) frames.
1721
1722 Each record contains a frame object, filename, line number, function
1723 name, a list of lines of context, and index within the context."""
1724 framelist = []
1725 while frame:
1726 traceback_info = getframeinfo(frame, context)
1727 frameinfo = (frame,) + traceback_info
1728 framelist.append(FrameInfo(*frameinfo, positions=traceback_info.positions))
1729 frame = frame.f_back
1730 return framelist
1731
1732def getinnerframes(tb, context=1):
1733 """Get a list of records for a traceback's frame and all lower frames.

Callers 1

stackFunction · 0.85

Calls 3

getframeinfoFunction · 0.85
FrameInfoClass · 0.85
appendMethod · 0.45

Tested by

no test coverage detected