summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-02-13 00:59:26 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2013-02-13 00:59:26 +0200
commit23376b168d76a2e3187b93884c2e96da7e87e735 (patch)
tree5db26b39493ef5d2eccad490f943cd1ea1b21993 /Lib
parent02c627c76571546884f10451da8f35122a21dd5e (diff)
downloadcpython-23376b168d76a2e3187b93884c2e96da7e87e735.tar.gz
Fix for issue #16800: Use buffered write to handle EINTR.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/tempfile.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/tempfile.py b/Lib/tempfile.py
index 0dbd889609..b90e826936 100644
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -177,8 +177,8 @@ def _get_default_tempdir():
fd = _os.open(filename, _bin_openflags, 0o600)
try:
try:
- fp = _io.open(fd, 'wb', buffering=0, closefd=False)
- fp.write(b'blat')
+ with _io.open(fd, 'wb', closefd=False) as fp:
+ fp.write(b'blat')
finally:
_os.close(fd)
finally: