(self, etype, value, elist, tb_offset=None,
context=5)
| 1460 | ListTB.__call__(self, etype, value, elist) |
| 1461 | |
| 1462 | def structured_traceback(self, etype, value, elist, tb_offset=None, |
| 1463 | context=5): |
| 1464 | # If the source file has been edited, the line in the syntax error can |
| 1465 | # be wrong (retrieved from an outdated cache). This replaces it with |
| 1466 | # the current value. |
| 1467 | if isinstance(value, SyntaxError) \ |
| 1468 | and isinstance(value.filename, str) \ |
| 1469 | and isinstance(value.lineno, int): |
| 1470 | linecache.checkcache(value.filename) |
| 1471 | newtext = linecache.getline(value.filename, value.lineno) |
| 1472 | if newtext: |
| 1473 | value.text = newtext |
| 1474 | self.last_syntax_error = value |
| 1475 | return super(SyntaxTB, self).structured_traceback(etype, value, elist, |
| 1476 | tb_offset=tb_offset, context=context) |
| 1477 | |
| 1478 | def clear_err_state(self): |
| 1479 | """Return the current error state and clear it""" |
nothing calls this directly
no test coverage detected