Clear all references to local variables in the frames of a traceback.
(tb)
| 265 | |
| 266 | |
| 267 | def clear_frames(tb): |
| 268 | "Clear all references to local variables in the frames of a traceback." |
| 269 | while tb is not None: |
| 270 | try: |
| 271 | tb.tb_frame.clear() |
| 272 | except RuntimeError: |
| 273 | # Ignore the exception raised if the frame is still executing. |
| 274 | pass |
| 275 | tb = tb.tb_next |
| 276 | |
| 277 | |
| 278 | class FrameSummary: |