[Python-checkins] cpython: Close #20814: doc: Fix "Pretty top" example of tracemalloc

victor.stinner python-checkins at python.org
Mon Mar 3 11:58:52 CET 2014


http://hg.python.org/cpython/rev/a9058b772807
changeset: 89467:a9058b772807
user: Victor Stinner <victor.stinner at gmail.com>
date: Mon Mar 03 11:57:57 2014 +0100
summary:
 Close #20814: doc: Fix "Pretty top" example of tracemalloc
files:
 Doc/library/tracemalloc.rst | 5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/Doc/library/tracemalloc.rst b/Doc/library/tracemalloc.rst
--- a/Doc/library/tracemalloc.rst
+++ b/Doc/library/tracemalloc.rst
@@ -200,8 +200,7 @@
 # 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 @@
 # ... run your application ...
 
 snapshot = tracemalloc.take_snapshot()
- display_top(snapshot, 10)
+ display_top(snapshot)
 
 Example of output of the Python test suite::
 
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /