(code, instruction_index)
| 1583 | return _get_code_position(code, instruction_index) |
| 1584 | |
| 1585 | def _get_code_position(code, instruction_index): |
| 1586 | if instruction_index < 0: |
| 1587 | return (None, None, None, None) |
| 1588 | positions_gen = code.co_positions() |
| 1589 | # The nth entry in code.co_positions() corresponds to instruction (2*n)th since Python 3.10+ |
| 1590 | return next(itertools.islice(positions_gen, instruction_index // 2, None)) |
| 1591 | |
| 1592 | def getframeinfo(frame, context=1): |
| 1593 | """Get information about a frame or traceback object. |
no test coverage detected
searching dependent graphs…