[Python-checkins] python/dist/src/Tools/faqwiz faqwiz.py,1.26,1.27
gvanrossum@users.sourceforge.net
gvanrossum@users.sourceforge.net
Fri, 09 Aug 2002 09:37:38 -0700
Update of /cvsroot/python/python/dist/src/Tools/faqwiz
In directory usw-pr-cvs1:/tmp/cvs-serv22967/Tools/faqwiz
Modified Files:
faqwiz.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: faqwiz.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/faqwiz/faqwiz.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** faqwiz.py 31 Mar 2000 00:58:00 -0000 1.26
--- faqwiz.py 9 Aug 2002 16:37:36 -0000 1.27
***************
*** 808,817 ****
import tempfile
! tfn = tempfile.mktemp()
! f = open(tfn, 'w')
! emit(LOGHEADER, self.ui, os.environ, date=date, _file=f)
! f.close()
! command = interpolate(SH_CHECKIN, file=file, tfn=tfn)
log("\n\n" + command)
p = os.popen(command)
--- 808,817 ----
import tempfile
! tf = tempfile.NamedTemporaryFile()
! emit(LOGHEADER, self.ui, os.environ, date=date, _file=tfn)
! tf.flush()
! tf.seek(0)
! command = interpolate(SH_CHECKIN, file=file, tfn=tf.name)
log("\n\n" + command)
p = os.popen(command)
***************
*** 820,824 ****
log("output: " + output)
log("done: " + str(sts))
! log("TempFile:\n" + open(tfn).read() + "end")
if not sts:
--- 820,824 ----
log("output: " + output)
log("done: " + str(sts))
! log("TempFile:\n" + tf.read() + "end")
if not sts: