mirror of
https://github.com/python/cpython.git
synced 2025-10-27 16:57:08 +00:00
#1565525: Add traceback.clear_frames() helper function to clear locals ref'd by a traceback
This commit is contained in:
parent
8408dc581e
commit
173a157e72
5 changed files with 62 additions and 1 deletions
|
|
@ -129,6 +129,13 @@ The module defines the following functions:
|
|||
|
||||
A shorthand for ``format_list(extract_stack(f, limit))``.
|
||||
|
||||
.. function:: clear_frames(tb)
|
||||
|
||||
Clears the local variables of all the stack frames in a traceback *tb*
|
||||
by calling the :meth:`clear` method of each frame object.
|
||||
|
||||
.. versionadded:: 3.4
|
||||
|
||||
|
||||
.. _traceback-example:
|
||||
|
||||
|
|
|
|||
|
|
@ -377,6 +377,14 @@ plain tuple. (Contributed by Claudiu Popa in :issue:`18901`.)
|
|||
:meth:`sunau.open` now supports the context manager protocol (:issue:`18878`).
|
||||
|
||||
|
||||
traceback
|
||||
---------
|
||||
|
||||
A new :func:`traceback.clear_frames` function takes a traceback object
|
||||
and clears the local variables in all of the frames it references,
|
||||
reducing the amount of memory consumed (:issue:`1565525`).
|
||||
|
||||
|
||||
urllib
|
||||
------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue