Print the list of tuples as returned by extract_tb() or extract_stack() as a formatted stack trace to the given file.
(extracted_list, file=None)
| 19 | # |
| 20 | |
| 21 | def print_list(extracted_list, file=None): |
| 22 | """Print the list of tuples as returned by extract_tb() or |
| 23 | extract_stack() as a formatted stack trace to the given file.""" |
| 24 | if file is None: |
| 25 | file = sys.stderr |
| 26 | for item in StackSummary.from_list(extracted_list).format(): |
| 27 | print(item, file=file, end="") |
| 28 | |
| 29 | def format_list(extracted_list): |
| 30 | """Format a list of tuples or FrameSummary objects for printing. |
no test coverage detected