[Python-checkins] python/dist/src/Lib/hotshot stones.py,1.1,1.2
gvanrossum@users.sourceforge.net
gvanrossum@users.sourceforge.net
Fri, 09 Aug 2002 09:37:37 -0700
Update of /cvsroot/python/python/dist/src/Lib/hotshot
In directory usw-pr-cvs1:/tmp/cvs-serv22967/Lib/hotshot
Modified Files:
stones.py
Log Message:
Massive changes from SF 589982 (tempfile.py rewrite, by Zack
Weinberg). This changes all uses of deprecated tempfile functions to
the recommended ones.
Index: stones.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/hotshot/stones.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** stones.py 18 Jul 2002 19:47:05 -0000 1.1
--- stones.py 9 Aug 2002 16:37:34 -0000 1.2
***************
*** 9,18 ****
if sys.argv[1:]:
logfile = sys.argv[1]
- cleanup = 0
else:
import tempfile
! logfile = tempfile.mktemp()
! cleanup = 1
!
p = hotshot.Profile(logfile)
--- 9,16 ----
if sys.argv[1:]:
logfile = sys.argv[1]
else:
import tempfile
! logf = tempfile.NamedTemporaryFile()
! logfile = logf.name
p = hotshot.Profile(logfile)
***************
*** 25,30 ****
stats = hotshot.stats.load(logfile)
- if cleanup:
- os.unlink(logfile)
stats.strip_dirs()
stats.sort_stats('time', 'calls')
--- 23,26 ----