diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-11-26 00:45:47 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-11-26 00:45:47 +0100 |
commit | 8e3708d88ba868eb2d915f0793c0bc0bb5f58b50 (patch) | |
tree | 36893b377fd02211512269ee557ba526479afb84 | |
parent | 00773df9f30f10fddef40fec13827cca8a1b21bc (diff) | |
download | cpython-git-8e3708d88ba868eb2d915f0793c0bc0bb5f58b50.tar.gz |
Issue #18874: allow to call tracemalloc.Snapshot.statistics(cumulative=True)
with traceback_limit=1
-rw-r--r-- | Doc/library/tracemalloc.rst | 3 | ||||
-rw-r--r-- | Lib/tracemalloc.py | 4 |
2 files changed, 1 insertions, 6 deletions
diff --git a/Doc/library/tracemalloc.rst b/Doc/library/tracemalloc.rst index 2e1902e959..be716e921e 100644 --- a/Doc/library/tracemalloc.rst +++ b/Doc/library/tracemalloc.rst @@ -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 diff --git a/Lib/tracemalloc.py b/Lib/tracemalloc.py index 7780eca77d..d51f1617ec 100644 --- a/Lib/tracemalloc.py +++ b/Lib/tracemalloc.py @@ -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 = {} |