| 1567 | _Traceback = namedtuple('_Traceback', 'filename lineno function code_context index') |
| 1568 | |
| 1569 | class Traceback(_Traceback): |
| 1570 | def __new__(cls, filename, lineno, function, code_context, index, *, positions=None): |
| 1571 | instance = super().__new__(cls, filename, lineno, function, code_context, index) |
| 1572 | instance.positions = positions |
| 1573 | return instance |
| 1574 | |
| 1575 | def __repr__(self): |
| 1576 | return ('Traceback(filename={!r}, lineno={!r}, function={!r}, ' |
| 1577 | 'code_context={!r}, index={!r}, positions={!r})'.format( |
| 1578 | self.filename, self.lineno, self.function, self.code_context, |
| 1579 | self.index, self.positions)) |
| 1580 | |
| 1581 | def _get_code_position_from_tb(tb): |
| 1582 | code, instruction_index = tb.tb_frame.f_code, tb.tb_lasti |
no outgoing calls
no test coverage detected
searching dependent graphs…