MCPcopy Index your code
hub / github.com/RustPython/RustPython / getouterframes

Function getouterframes

Lib/inspect.py:1629–1640  ·  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

1627 self.code_context, self.index, self.positions))
1628
1629def getouterframes(frame, context=1):
1630 """Get a list of records for a frame and all higher (calling) frames.
1631
1632 Each record contains a frame object, filename, line number, function
1633 name, a list of lines of context, and index within the context."""
1634 framelist = []
1635 while frame:
1636 traceback_info = getframeinfo(frame, context)
1637 frameinfo = (frame,) + traceback_info
1638 framelist.append(FrameInfo(*frameinfo, positions=traceback_info.positions))
1639 frame = frame.f_back
1640 return framelist
1641
1642def getinnerframes(tb, context=1):
1643 """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.70
appendMethod · 0.45

Tested by

no test coverage detected