diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2013-02-12 22:59:11 (GMT) |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-02-12 22:59:11 (GMT) |
| commit | 7d360038f5cfd5c15d55d81bb71848a11a09120c (patch) | |
| tree | bc43a39a30371bcddeb8ceb1cbf502ded8fa2b7e | |
| parent | 0127de0b877600a95871e07aee8a092e9199002a (diff) | |
| download | cpython-7d360038f5cfd5c15d55d81bb71848a11a09120c.zip cpython-7d360038f5cfd5c15d55d81bb71848a11a09120c.tar.gz cpython-7d360038f5cfd5c15d55d81bb71848a11a09120c.tar.bz2 | |
Fix for issue #16800: Use buffered write to handle EINTR.
| -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 d2af8a6..2dfc609 100644 --- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -197,8 +197,8 @@ def _get_default_tempdir(): fd = _os.open(filename, flags, 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: |
