[Python-checkins] r45673 - python/trunk/Doc/lib/libtrace.tex

skip.montanaro python-checkins at python.org
Sun Apr 23 21:30:50 CEST 2006


Author: skip.montanaro
Date: Sun Apr 23 21:30:50 2006
New Revision: 45673

Modified:
   python/trunk/Doc/lib/libtrace.tex
Log:
it's always helpful if the example works...

Modified: python/trunk/Doc/lib/libtrace.tex
==============================================================================
--- python/trunk/Doc/lib/libtrace.tex	(original)
+++ python/trunk/Doc/lib/libtrace.tex	Sun Apr 23 21:30:50 2006
@@ -83,13 +83,15 @@
 \subsubsection{Example}
 
 \begin{verbatim}
+import sys
+
 # create a Trace object, telling it what to ignore, and whether to
 # do tracing or line-counting or both.
-trace = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix,], trace=0,
+tracer = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix,], trace=0,
 		    count=1)
-# run the new command using the given trace
-trace.run('main()')
-# make a report, telling it where you want output
-r = trace.results()
-r.write_results(show_missing=True)
+# run the new command using the given tracer
+tracer.run('main()')
+# make a report, placing output in /tmp
+r = tracer.results()
+r.write_results(show_missing=True, coverdir="/tmp")
 \end{verbatim}


More information about the Python-checkins mailing list