(self, count=None)
| 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: |
no test coverage detected