Print out a formatted exception traceback. Optional arguments: - out: an open file-like object to direct output to. - tb_offset: the number of frames to skip over in the stack, on a per-call basis (this overrides temporarily the instance's tb_offset
(self, etype=None, evalue=None, etb=None,
out=None, tb_offset=None)
| 1400 | """ |
| 1401 | |
| 1402 | def __call__(self, etype=None, evalue=None, etb=None, |
| 1403 | out=None, tb_offset=None): |
| 1404 | """Print out a formatted exception traceback. |
| 1405 | |
| 1406 | Optional arguments: |
| 1407 | - out: an open file-like object to direct output to. |
| 1408 | |
| 1409 | - tb_offset: the number of frames to skip over in the stack, on a |
| 1410 | per-call basis (this overrides temporarily the instance's tb_offset |
| 1411 | given at initialization time. """ |
| 1412 | |
| 1413 | if out is None: |
| 1414 | out = self.ostream |
| 1415 | out.flush() |
| 1416 | out.write(self.text(etype, evalue, etb, tb_offset)) |
| 1417 | out.write('\n') |
| 1418 | out.flush() |
| 1419 | # FIXME: we should remove the auto pdb behavior from here and leave |
| 1420 | # that to the clients. |
| 1421 | try: |
| 1422 | self.debugger() |
| 1423 | except KeyboardInterrupt: |
| 1424 | print("\nKeyboardInterrupt") |
| 1425 | |
| 1426 | def structured_traceback(self, etype=None, value=None, tb=None, |
| 1427 | tb_offset=None, number_of_lines_of_context=5): |