summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-03-03 10:57:57 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-03-03 10:57:57 (GMT)
commitf70200e5a90b83348f331d2a3b91db24d2c8365e (patch)
tree31935f5c1f8f9004ee84d191bdc852cd5ad1543b /Doc/library
parent8be77910be2ada98fe42d632c8f6363a4a31129e (diff)
downloadcpython-f70200e5a90b83348f331d2a3b91db24d2c8365e.zip
cpython-f70200e5a90b83348f331d2a3b91db24d2c8365e.tar.gz
cpython-f70200e5a90b83348f331d2a3b91db24d2c8365e.tar.bz2
Close #20814: doc: Fix "Pretty top" example of tracemalloc
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/tracemalloc.rst5
1 files changed, 2 insertions, 3 deletions
diff --git a/Doc/library/tracemalloc.rst b/Doc/library/tracemalloc.rst
index b79c5f6..c12ef87 100644
--- a/Doc/library/tracemalloc.rst
+++ b/Doc/library/tracemalloc.rst
@@ -200,8 +200,7 @@ ignoring ``<frozen importlib._bootstrap>`` and ``<unknown>`` files::
# replace "/path/to/module/file.py" with "module/file.py"
filename = os.sep.join(frame.filename.split(os.sep)[-2:])
print("#%s: %s:%s: %.1f KiB"
- % (index, filename, frame.lineno,
- stat.size / 1024))
+ % (index, filename, frame.lineno, stat.size / 1024))
other = top_stats[limit:]
if other:
@@ -215,7 +214,7 @@ ignoring ``<frozen importlib._bootstrap>`` and ``<unknown>`` files::
# ... run your application ...
snapshot = tracemalloc.take_snapshot()
- display_top(snapshot, 10)
+ display_top(snapshot)
Example of output of the Python test suite::