]> granicus.if.org Git - python/commitdiff
it's always helpful if the example works...
authorSkip Montanaro <skip@pobox.com>
Sun, 23 Apr 2006 19:30:50 +0000 (19:30 +0000)
committerSkip Montanaro <skip@pobox.com>
Sun, 23 Apr 2006 19:30:50 +0000 (19:30 +0000)
Doc/lib/libtrace.tex

index f13e8aedafc59d4bb48dc7da7f578505bcfd88dc..65d13522b7c9de7e1a9618a7d29938b9abd02a6d 100644 (file)
@@ -83,13 +83,15 @@ object with the current tracing parameters.
 \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}