MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / extract

Method extract

tools/python-3.11.9-amd64/Lib/traceback.py:373–392  ·  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.

(klass, frame_gen, *, limit=None, lookup_lines=True,
            capture_locals=False)

Source from the content-addressed store, hash-verified

371
372 @classmethod
373 def extract(klass, frame_gen, *, limit=None, lookup_lines=True,
374 capture_locals=False):
375 """Create a StackSummary from a traceback or stack object.
376
377 :param frame_gen: A generator that yields (frame, lineno) tuples
378 whose summaries are to be included in the stack.
379 :param limit: None to include all frames or the number of frames to
380 include.
381 :param lookup_lines: If True, lookup lines for each frame immediately,
382 otherwise lookup is deferred until the frame is rendered.
383 :param capture_locals: If True, the local variables from each frame will
384 be captured as object representations into the FrameSummary.
385 """
386 def extended_frame_gen():
387 for f, lineno in frame_gen:
388 yield f, (lineno, None, None, None)
389
390 return klass._extract_from_extended_frame_gen(
391 extended_frame_gen(), limit=limit, lookup_lines=lookup_lines,
392 capture_locals=capture_locals)
393
394 @classmethod
395 def _extract_from_extended_frame_gen(klass, frame_gen, *, limit=None,

Callers 1

extract_stackFunction · 0.45

Tested by

no test coverage detected