mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
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:
parent
830a5151c1
commit
3b0a3293c3
31 changed files with 134 additions and 149 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue