diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-02-12 23:00:17 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-02-12 23:00:17 (GMT) |
commit | 7e298d0aa5a77f799993cbf09f88c1703602b34c (patch) | |
tree | cd125792e43cd2c68bf0e8579419d5bd1a8d097d /Lib/tempfile.py | |
parent | 94cd10fa19d7174ce07c4680a1be7a94cb29dd8b (diff) | |
parent | bebd2063e1f3b0d22cdf1d4d6e0b44468132173c (diff) | |
download | cpython-7e298d0aa5a77f799993cbf09f88c1703602b34c.zip cpython-7e298d0aa5a77f799993cbf09f88c1703602b34c.tar.gz cpython-7e298d0aa5a77f799993cbf09f88c1703602b34c.tar.bz2 |
Fix for issue #16800: Use buffered write to handle EINTR.
Diffstat (limited to 'Lib/tempfile.py')
-rw-r--r-- | Lib/tempfile.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/tempfile.py b/Lib/tempfile.py index 21c7186..10b6a1b 100644 --- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -176,8 +176,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: |