Print all Python thread tracebacks.
()
| 181 | |
| 182 | |
| 183 | def print_thread_tracebacks() -> None: |
| 184 | """Print all Python thread tracebacks.""" |
| 185 | for thread_id, frame in sys._current_frames().items(): |
| 186 | sys.stderr.write(f"\n--- Traceback for thread {thread_id} ---\n") |
| 187 | traceback.print_stack(frame, file=sys.stderr) |
| 188 | |
| 189 | |
| 190 | def print_thread_stacks(pid: int) -> None: |
no test coverage detected