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

Function _get_code_position

tools/python-3.11.9-amd64/Lib/inspect.py:1651–1656  ·  view source on GitHub ↗
(code, instruction_index)

Source from the content-addressed store, hash-verified

1649 return _get_code_position(code, instruction_index)
1650
1651def _get_code_position(code, instruction_index):
1652 if instruction_index < 0:
1653 return (None, None, None, None)
1654 positions_gen = code.co_positions()
1655 # The nth entry in code.co_positions() corresponds to instruction (2*n)th since Python 3.10+
1656 return next(itertools.islice(positions_gen, instruction_index // 2, None))
1657
1658def getframeinfo(frame, context=1):
1659 """Get information about a frame or traceback object.

Callers 2

getframeinfoFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected