On this page
traceback.clear_frames
Up: traceback | Next: traceback.extract_stack
Rel: traceback.extract_stack, traceback.extract_tb, traceback.format_exc, traceback.format_exception
Ref: docs.python.org — traceback.clear_frames
Tags: #public #python3 #stdlib #traceback
Import
import traceback
from traceback import clear_frames
Signature & Overview
traceback.clear_frames(tb)
Clear all references to local variables in the frames of a traceback.
Usage
import traceback
try:
1 / 0
except ZeroDivisionError as exc:
traceback.clear_frames(exc.__traceback__)
Gotchas
- Breaks reference cycles and frees local variables attached to stored tracebacks.
REPL Inspect
from traceback import clear_frames
help(clear_frames)
Linked from
- tuts/python3/stdlib_module/traceback
- tuts/python3/stdlib_module/traceback/extract_stack
- tuts/python3/stdlib_module/traceback/extract_tb
- tuts/python3/stdlib_module/traceback/format_exc
- tuts/python3/stdlib_module/traceback/format_exception
- tuts/python3/stdlib_module/traceback/format_exception_only
- tuts/python3/stdlib_module/traceback/format_list
- tuts/python3/stdlib_module/traceback/format_stack
- tuts/python3/stdlib_module/traceback/format_tb
- tuts/python3/stdlib_module/traceback/FrameSummary
- tuts/python3/stdlib_module/traceback/print_exc
- tuts/python3/stdlib_module/traceback/print_exception
- tuts/python3/stdlib_module/traceback/print_last
- tuts/python3/stdlib_module/traceback/print_list
- tuts/python3/stdlib_module/traceback/print_stack
- tuts/python3/stdlib_module/traceback/print_tb
- tuts/python3/stdlib_module/traceback/StackSummary
- tuts/python3/stdlib_module/traceback/TracebackException
- tuts/python3/stdlib_module/traceback/walk_stack
- tuts/python3/stdlib_module/traceback/walk_tb
Related notes
- tuts/python3/stdlib_module/traceback/extract_stack Linked here; links to this page; shared tags: #stdlib, #traceback
- tuts/python3/stdlib_module/traceback/extract_tb Linked here; links to this page; shared tags: #stdlib, #traceback
- tuts/python3/stdlib_module/traceback/format_exc Linked here; links to this page; shared tags: #stdlib, #traceback
- tuts/python3/stdlib_module/traceback/format_exception Linked here; links to this page; shared tags: #stdlib, #traceback
- tuts/python3/stdlib_module/traceback Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/traceback/format_exception_only links to this page; shared tags: #stdlib, #traceback
- tuts/python3/stdlib_module/traceback/format_list links to this page; shared tags: #stdlib, #traceback
- tuts/python3/stdlib_module/traceback/format_stack links to this page; shared tags: #stdlib, #traceback
- tuts/python3/stdlib_module/traceback/format_tb links to this page; shared tags: #stdlib, #traceback
- tuts/python3/stdlib_module/traceback/FrameSummary links to this page; shared tags: #stdlib, #traceback