Create a StackSummary from a traceback or stack object. :param frame_gen: A generator that yields (frame, lineno) tuples whose summaries are to be included in the stack. :param limit: None to include all frames or the number of frames to include. :par
(klass, frame_gen, *, limit=None, lookup_lines=True,
capture_locals=False)
| 452 | |
| 453 | @classmethod |
| 454 | def extract(klass, frame_gen, *, limit=None, lookup_lines=True, |
| 455 | capture_locals=False): |
| 456 | """Create a StackSummary from a traceback or stack object. |
| 457 | |
| 458 | :param frame_gen: A generator that yields (frame, lineno) tuples |
| 459 | whose summaries are to be included in the stack. |
| 460 | :param limit: None to include all frames or the number of frames to |
| 461 | include. |
| 462 | :param lookup_lines: If True, lookup lines for each frame immediately, |
| 463 | otherwise lookup is deferred until the frame is rendered. |
| 464 | :param capture_locals: If True, the local variables from each frame will |
| 465 | be captured as object representations into the FrameSummary. |
| 466 | """ |
| 467 | def extended_frame_gen(): |
| 468 | for f, lineno in frame_gen: |
| 469 | yield f, (lineno, None, None, None) |
| 470 | |
| 471 | return klass._extract_from_extended_frame_gen( |
| 472 | extended_frame_gen(), limit=limit, lookup_lines=lookup_lines, |
| 473 | capture_locals=capture_locals) |
| 474 | |
| 475 | @classmethod |
| 476 | def _extract_from_extended_frame_gen(klass, frame_gen, *, limit=None, |
no test coverage detected