[Python-checkins] cpython: Issue #18874: allow to call tracemalloc.Snapshot.statistics(cumulative=True)

victor.stinner python-checkins at python.org
Tue Nov 26 00:46:01 CET 2013


http://hg.python.org/cpython/rev/a2811425dbde
changeset:   87569:a2811425dbde
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Tue Nov 26 00:45:47 2013 +0100
summary:
  Issue #18874: allow to call tracemalloc.Snapshot.statistics(cumulative=True)
with traceback_limit=1

files:
  Doc/library/tracemalloc.rst |  3 +--
  Lib/tracemalloc.py          |  4 ----
  2 files changed, 1 insertions(+), 6 deletions(-)


diff --git a/Doc/library/tracemalloc.rst b/Doc/library/tracemalloc.rst
--- a/Doc/library/tracemalloc.rst
+++ b/Doc/library/tracemalloc.rst
@@ -479,8 +479,7 @@
       If *cumulative* is ``True``, cumulate size and count of memory blocks of
       all frames of the traceback of a trace, not only the most recent frame.
       The cumulative mode can only be used with *group_by* equals to
-      ``'filename'`` and ``'lineno'`` and :attr:`traceback_limit` greater than
-      ``1``.
+      ``'filename'`` and ``'lineno'``.
 
       The result is sorted from the biggest to the smallest by:
       :attr:`Statistic.size`, :attr:`Statistic.count` and then by
diff --git a/Lib/tracemalloc.py b/Lib/tracemalloc.py
--- a/Lib/tracemalloc.py
+++ b/Lib/tracemalloc.py
@@ -380,10 +380,6 @@
         if cumulative and key_type not in ('lineno', 'filename'):
             raise ValueError("cumulative mode cannot by used "
                              "with key type %r" % key_type)
-        if cumulative and self.traceback_limit < 2:
-            raise ValueError("cumulative mode needs tracebacks with at least "
-                             "2 frames, traceback limit is %s"
-                             % self.traceback_limit)
 
         stats = {}
         tracebacks = {}

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list