]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #18874: allow to call tracemalloc.Snapshot.statistics(cumulative=True)
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 25 Nov 2013 23:45:47 +0000 (00:45 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 25 Nov 2013 23:45:47 +0000 (00:45 +0100)
with traceback_limit=1

Doc/library/tracemalloc.rst
Lib/tracemalloc.py

index 2e1902e9591c2fbdc77f130ddd38e9aa4cef72fc..be716e921ec4e9fef45dccc2e507b0141d1c6435 100644 (file)
@@ -479,8 +479,7 @@ Snapshot
       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
index 7780eca77d701c1c93391685e4a9c3ac383a40cf..d51f1617ece5ff36c061c037049cc1b0a86c5fef 100644 (file)
@@ -380,10 +380,6 @@ class Snapshot:
         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 = {}