Show More
@@ -627,6 +627,12 b' class ListTB(TBTools):' | |||
|
627 | 627 | self.ostream.write(self.text(etype, value, elist)) |
|
628 | 628 | self.ostream.write('\n') |
|
629 | 629 | |
|
630 | def _extract_tb(self, tb): | |
|
631 | if tb: | |
|
632 | return traceback.extract_tb(tb) | |
|
633 | else: | |
|
634 | return None | |
|
635 | ||
|
630 | 636 | def structured_traceback(self, etype, evalue, etb=None, tb_offset=None, |
|
631 | 637 | context=5): |
|
632 | 638 | """Return a color formatted string with the traceback info. |
@@ -1303,12 +1309,6 b' class FormattedTB(VerboseTB, ListTB):' | |||
|
1303 | 1309 | # set_mode also sets the tb_join_char attribute |
|
1304 | 1310 | self.set_mode(mode) |
|
1305 | 1311 | |
|
1306 | def _extract_tb(self, tb): | |
|
1307 | if tb: | |
|
1308 | return traceback.extract_tb(tb) | |
|
1309 | else: | |
|
1310 | return None | |
|
1311 | ||
|
1312 | 1312 | def structured_traceback(self, etype, value, tb, tb_offset=None, number_of_lines_of_context=5): |
|
1313 | 1313 | tb_offset = self.tb_offset if tb_offset is None else tb_offset |
|
1314 | 1314 | mode = self.mode |
@@ -1409,7 +1409,11 b' class AutoFormattedTB(FormattedTB):' | |||
|
1409 | 1409 | tb_offset=None, number_of_lines_of_context=5): |
|
1410 | 1410 | if etype is None: |
|
1411 | 1411 | etype, value, tb = sys.exc_info() |
|
1412 | self.tb = tb | |
|
1412 | if isinstance(tb, tuple): | |
|
1413 | # tb is a tuple if this is a chained exception. | |
|
1414 | self.tb = tb[0] | |
|
1415 | else: | |
|
1416 | self.tb = tb | |
|
1413 | 1417 | return FormattedTB.structured_traceback( |
|
1414 | 1418 | self, etype, value, tb, tb_offset, number_of_lines_of_context) |
|
1415 | 1419 |
General Comments 0
You need to be logged in to leave comments.
Login now