diff options
author | shadchin <shadchin@yandex-team.com> | 2025-06-13 00:05:26 +0300 |
---|---|---|
committer | shadchin <shadchin@yandex-team.com> | 2025-06-13 00:35:30 +0300 |
commit | 796b9088366b10b4cd42885101fc20c0b5709b07 (patch) | |
tree | f287eacb0b95ffd7cabf95b16cafb4788645dc38 /contrib/tools/python3/Lib/tempfile.py | |
parent | c72bca862651e507d2ff4980ef7f4ff7267a7227 (diff) | |
download | ydb-796b9088366b10b4cd42885101fc20c0b5709b07.tar.gz |
Update Python 3 to 3.12.10
commit_hash:dd2398e159fe1d72ea6b12da52fccc933a41a785
Diffstat (limited to 'contrib/tools/python3/Lib/tempfile.py')
-rw-r--r-- | contrib/tools/python3/Lib/tempfile.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/contrib/tools/python3/Lib/tempfile.py b/contrib/tools/python3/Lib/tempfile.py index cbfc172a789..67c02db124d 100644 --- a/contrib/tools/python3/Lib/tempfile.py +++ b/contrib/tools/python3/Lib/tempfile.py @@ -848,10 +848,14 @@ class SpooledTemporaryFile(_io.IOBase): return rv def writelines(self, iterable): - file = self._file - rv = file.writelines(iterable) - self._check(file) - return rv + if self._max_size == 0 or self._rolled: + return self._file.writelines(iterable) + + it = iter(iterable) + for line in it: + self.write(line) + if self._rolled: + return self._file.writelines(it) def detach(self): return self._file.detach() |