summaryrefslogtreecommitdiffstats
path: root/Lib/hotshot/stones.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/hotshot/stones.py')
-rw-r--r--Lib/hotshot/stones.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/Lib/hotshot/stones.py b/Lib/hotshot/stones.py
index 5a029d5..e171fbc 100644
--- a/Lib/hotshot/stones.py
+++ b/Lib/hotshot/stones.py
@@ -8,12 +8,10 @@ import test.pystone
if sys.argv[1:]:
logfile = sys.argv[1]
- cleanup = 0
else:
import tempfile
- logfile = tempfile.mktemp()
- cleanup = 1
-
+ logf = tempfile.NamedTemporaryFile()
+ logfile = logf.name
p = hotshot.Profile(logfile)
benchtime, stones = p.runcall(test.pystone.pystones)
@@ -24,8 +22,6 @@ print "Pystone(%s) time for %d passes = %g" % \
print "This machine benchmarks at %g pystones/second" % stones
stats = hotshot.stats.load(logfile)
-if cleanup:
- os.unlink(logfile)
stats.strip_dirs()
stats.sort_stats('time', 'calls')
try: