MCPcopy Index your code
hub / github.com/RustPython/RustPython / extract

Method extract

Lib/traceback.py:438–457  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

436
437 @classmethod
438 def extract(klass, frame_gen, *, limit=None, lookup_lines=True,
439 capture_locals=False):
440 """Create a StackSummary from a traceback or stack object.
441
442 :param frame_gen: A generator that yields (frame, lineno) tuples
443 whose summaries are to be included in the stack.
444 :param limit: None to include all frames or the number of frames to
445 include.
446 :param lookup_lines: If True, lookup lines for each frame immediately,
447 otherwise lookup is deferred until the frame is rendered.
448 :param capture_locals: If True, the local variables from each frame will
449 be captured as object representations into the FrameSummary.
450 """
451 def extended_frame_gen():
452 for f, lineno in frame_gen:
453 yield f, (lineno, None, None, None)
454
455 return klass._extract_from_extended_frame_gen(
456 extended_frame_gen(), limit=limit, lookup_lines=lookup_lines,
457 capture_locals=capture_locals)
458
459 @classmethod
460 def _extract_from_extended_frame_gen(klass, frame_gen, *, limit=None,

Callers 1

extract_stackFunction · 0.45

Tested by

no test coverage detected