MCPcopy Index your code
hub / github.com/python/cpython / getinnerframes

Function getinnerframes

Lib/inspect.py:1666–1677  ·  view source on GitHub ↗

Get a list of records for a traceback's frame and all lower frames. Each record contains a frame object, filename, line number, function name, a list of lines of context, and index within the context.

(tb, context=1)

Source from the content-addressed store, hash-verified

1664 return framelist
1665
1666def getinnerframes(tb, context=1):
1667 """Get a list of records for a traceback's frame and all lower frames.
1668
1669 Each record contains a frame object, filename, line number, function
1670 name, a list of lines of context, and index within the context."""
1671 framelist = []
1672 while tb:
1673 traceback_info = getframeinfo(tb, context)
1674 frameinfo = (tb.tb_frame,) + traceback_info
1675 framelist.append(FrameInfo(*frameinfo, positions=traceback_info.positions))
1676 tb = tb.tb_next
1677 return framelist
1678
1679def currentframe():
1680 """Return the frame of the caller or None if this is not possible."""

Callers 1

traceFunction · 0.85

Calls 3

getframeinfoFunction · 0.85
FrameInfoClass · 0.70
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…