summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/distutils/util.py')
-rw-r--r--Lib/distutils/util.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py
index 23c29eb..d9c6224 100644
--- a/Lib/distutils/util.py
+++ b/Lib/distutils/util.py
@@ -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