summaryrefslogtreecommitdiffstats
path: root/Lib/tempfile.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2007-08-05 22:23:10 (GMT)
committerBrett Cannon <bcannon@gmail.com>2007-08-05 22:23:10 (GMT)
commitdd766d53a2feebf1eef3d27c7192d0adc38d2fdd (patch)
tree5b54bd68011379ca46b9ab2860eb64d37829dac8 /Lib/tempfile.py
parent9c121069d3a61868f4586ad2ba2e5435a82af061 (diff)
downloadcpython-dd766d53a2feebf1eef3d27c7192d0adc38d2fdd.zip
cpython-dd766d53a2feebf1eef3d27c7192d0adc38d2fdd.tar.gz
cpython-dd766d53a2feebf1eef3d27c7192d0adc38d2fdd.tar.bz2
Move tempfile over to the io module. Makes test_threaded_import pass.
Thanks Paul Colomiets.
Diffstat (limited to 'Lib/tempfile.py')
-rw-r--r--Lib/tempfile.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/tempfile.py b/Lib/tempfile.py
index 68cc540..82e5ec0 100644
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -197,7 +197,7 @@ def _get_default_tempdir():
filename = _os.path.join(dir, name)
try:
fd = _os.open(filename, flags, 0o600)
- fp = _os.fdopen(fd, 'w')
+ fp = _io.open(fd, 'w')
fp.write('blat')
fp.close()
_os.unlink(filename)
@@ -438,7 +438,7 @@ def NamedTemporaryFile(mode='w+b', bufsize=-1, suffix="",
flags |= _os.O_TEMPORARY
(fd, name) = _mkstemp_inner(dir, prefix, suffix, flags)
- file = _os.fdopen(fd, mode, bufsize)
+ file = _io.open(fd, mode, bufsize)
return _TemporaryFileWrapper(file, name, delete)
if _os.name != 'posix' or _os.sys.platform == 'cygwin':
@@ -471,7 +471,7 @@ else:
(fd, name) = _mkstemp_inner(dir, prefix, suffix, flags)
try:
_os.unlink(name)
- return _os.fdopen(fd, mode, bufsize)
+ return _io.open(fd, mode, bufsize)
except:
_os.close(fd)
raise