summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-02-12 22:59:53 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-02-12 22:59:53 (GMT)
commitbebd2063e1f3b0d22cdf1d4d6e0b44468132173c (patch)
tree7ac99b1bdd22b958267534de1515c76e279ecf6a /Lib
parentff7fef9601d15cdf274b4b984c7638f33002e879 (diff)
parent76a2ed1398e2223bfe01c930e79fe314b4d02feb (diff)
downloadcpython-bebd2063e1f3b0d22cdf1d4d6e0b44468132173c.zip
cpython-bebd2063e1f3b0d22cdf1d4d6e0b44468132173c.tar.gz
cpython-bebd2063e1f3b0d22cdf1d4d6e0b44468132173c.tar.bz2
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 3c3aec1..4aad7b5 100644
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -174,8 +174,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: