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, text), a
(f=None, limit=None)
| 259 | |
| 260 | |
| 261 | def extract_stack(f=None, limit=None): |
| 262 | """Extract the raw traceback from the current stack frame. |
| 263 | |
| 264 | The return value has the same format as for extract_tb(). The |
| 265 | optional 'f' and 'limit' arguments have the same meaning as for |
| 266 | print_stack(). Each item in the list is a quadruple (filename, |
| 267 | line number, function name, text), and the entries are in order |
| 268 | from oldest to newest stack frame. |
| 269 | """ |
| 270 | if f is None: |
| 271 | f = sys._getframe().f_back |
| 272 | stack = StackSummary.extract(walk_stack(f), limit=limit) |
| 273 | stack.reverse() |
| 274 | return stack |
| 275 | |
| 276 | |
| 277 | def clear_frames(tb): |
searching dependent graphs…