Walk a stack yielding the frame and line number for each frame. This will follow f.f_back from the given frame. If no frame is given, the current stack is used. Usually used with StackSummary.extract.
(f)
| 320 | |
| 321 | |
| 322 | def walk_stack(f): |
| 323 | """Walk a stack yielding the frame and line number for each frame. |
| 324 | |
| 325 | This will follow f.f_back from the given frame. If no frame is given, the |
| 326 | current stack is used. Usually used with StackSummary.extract. |
| 327 | """ |
| 328 | if f is None: |
| 329 | f = sys._getframe().f_back.f_back.f_back.f_back |
| 330 | while f is not None: |
| 331 | yield f, f.f_lineno |
| 332 | f = f.f_back |
| 333 | |
| 334 | |
| 335 | def walk_tb(tb): |