summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/traceback.rst7
-rw-r--r--Doc/whatsnew/3.4.rst8
2 files changed, 15 insertions, 0 deletions
diff --git a/Doc/library/traceback.rst b/Doc/library/traceback.rst
index 0533bea..b68a8f1 100644
--- a/Doc/library/traceback.rst
+++ b/Doc/library/traceback.rst
@@ -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:
diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst
index e91ce2a..89912a9 100644
--- a/Doc/whatsnew/3.4.rst
+++ b/Doc/whatsnew/3.4.rst
@@ -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
------