(code, instruction_index)
| 1559 | return _get_code_position(code, instruction_index) |
| 1560 | |
| 1561 | def _get_code_position(code, instruction_index): |
| 1562 | if instruction_index < 0: |
| 1563 | return (None, None, None, None) |
| 1564 | positions_gen = code.co_positions() |
| 1565 | # The nth entry in code.co_positions() corresponds to instruction (2*n)th since Python 3.10+ |
| 1566 | return next(itertools.islice(positions_gen, instruction_index // 2, None)) |
| 1567 | |
| 1568 | def getframeinfo(frame, context=1): |
| 1569 | """Get information about a frame or traceback object. |
no test coverage detected