MCPcopy Index your code
hub / github.com/python/cpython / extract_stack

Function extract_stack

Lib/asyncio/format_helpers.py:70–84  ·  view source on GitHub ↗

Replacement for traceback.extract_stack() that only does the necessary work for asyncio debug mode.

(f=None, limit=None)

Source from the content-addressed store, hash-verified

68
69
70def extract_stack(f=None, limit=None):
71 """Replacement for traceback.extract_stack() that only does the
72 necessary work for asyncio debug mode.
73 """
74 if f is None:
75 f = sys._getframe().f_back
76 if limit is None:
77 # Limit the amount of work to a reasonable amount, as extract_stack()
78 # can be called for each coroutine and future in debug mode.
79 limit = constants.DEBUG_STACK_DEPTH
80 stack = traceback.StackSummary.extract(traceback.walk_stack(f),
81 limit=limit,
82 lookup_lines=False)
83 stack.reverse()
84 return stack

Callers

nothing calls this directly

Calls 2

extractMethod · 0.45
reverseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…