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

Method print_stack_trace

Lib/pdb.py:2453–2466  ·  view source on GitHub ↗
(self, count=None)

Source from the content-addressed store, hash-verified

2451 # * if count > 0, prints count most recent frame entries
2452
2453 def print_stack_trace(self, count=None):
2454 if count is None:
2455 stack_to_print = self.stack
2456 elif count == 0:
2457 stack_to_print = [self.stack[self.curindex]]
2458 elif count < 0:
2459 stack_to_print = self.stack[:-count]
2460 else:
2461 stack_to_print = self.stack[-count:]
2462 try:
2463 for frame_lineno in stack_to_print:
2464 self.print_stack_entry(frame_lineno)
2465 except KeyboardInterrupt:
2466 pass
2467
2468 def print_stack_entry(self, frame_lineno, prompt_prefix=None):
2469 if prompt_prefix is None:

Callers 2

do_whereMethod · 0.95

Calls 1

print_stack_entryMethod · 0.95

Tested by

no test coverage detected