Extract the raw traceback from the current stack frame. The return value has the same format as for extract_tb(). The optional 'f' and 'limit' arguments have the same meaning as for print_stack(). Each item in the list is a quadruple (filename, line number, function name, tex
(f=None, limit=None)
| 215 | |
| 216 | |
| 217 | def extract_stack(f=None, limit=None): |
| 218 | """Extract the raw traceback from the current stack frame. |
| 219 | |
| 220 | The return value has the same format as for extract_tb(). The |
| 221 | optional 'f' and 'limit' arguments have the same meaning as for |
| 222 | print_stack(). Each item in the list is a quadruple (filename, |
| 223 | line number, function name, text), and the entries are in order |
| 224 | from oldest to newest stack frame. |
| 225 | """ |
| 226 | if f is None: |
| 227 | f = sys._getframe().f_back |
| 228 | stack = StackSummary.extract(walk_stack(f), limit=limit) |
| 229 | stack.reverse() |
| 230 | return stack |
| 231 | |
| 232 | |
| 233 | def clear_frames(tb): |
no test coverage detected