Massive changes from SF 589982 (tempfile.py rewrite, by Zack

Weinberg).  This changes all uses of deprecated tempfile functions to
the recommended ones.
This commit is contained in:
Guido van Rossum 2002-08-09 16:38:32 +00:00
parent 830a5151c1
commit 3b0a3293c3
31 changed files with 134 additions and 149 deletions

View file

@ -359,11 +359,11 @@ def byte_compile (py_files,
# "Indirect" byte-compilation: write a temporary script and then
# run it with the appropriate flags.
if not direct:
from tempfile import mktemp
script_name = mktemp(".py")
from tempfile import mkstemp
(script_fd, script_name) = mkstemp(".py")
log.info("writing byte-compilation script '%s'", script_name)
if not dry_run:
script = open(script_name, "w")
script = os.fdopen(script_fd, "w")
script.write("""\
from distutils.util import byte_compile