Close #20814: doc: Fix "Pretty top" example of tracemalloc

This commit is contained in:
Victor Stinner 2014-03-03 11:57:57 +01:00
parent 0c3ea0942d
commit adb2e2ab64
1 changed files with 2 additions and 3 deletions

View File

@ -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::