Return a StackSummary object representing a list of pre-processed entries from traceback. This is useful for alternate formatting of stack traces. If 'limit' is omitted or None, all entries are extracted. A pre-processed stack trace entry is a FrameSummary object containi
(tb, limit=None)
| 67 | return extract_tb(tb, limit=limit).format() |
| 68 | |
| 69 | def extract_tb(tb, limit=None): |
| 70 | """ |
| 71 | Return a StackSummary object representing a list of |
| 72 | pre-processed entries from traceback. |
| 73 | |
| 74 | This is useful for alternate formatting of stack traces. If |
| 75 | 'limit' is omitted or None, all entries are extracted. A |
| 76 | pre-processed stack trace entry is a FrameSummary object |
| 77 | containing attributes filename, lineno, name, and line |
| 78 | representing the information that is usually printed for a stack |
| 79 | trace. The line is a string with leading and trailing |
| 80 | whitespace stripped; if the source is not available it is None. |
| 81 | """ |
| 82 | return StackSummary._extract_from_extended_frame_gen( |
| 83 | _walk_tb_with_full_positions(tb), limit=limit) |
| 84 | |
| 85 | # |
| 86 | # Exception formatting and output. |