summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-03-05 22:33:59 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-03-05 22:33:59 (GMT)
commit394ee00993b5bc02d5567c9d293f42ed289c32bf (patch)
tree048e221b088881cdbb5c93b9f9d1110cdb7c5283 /Lib
parent36a30cefd7a10d604617eb3309ecdcf64e257f54 (diff)
downloadcpython-394ee00993b5bc02d5567c9d293f42ed289c32bf.zip
cpython-394ee00993b5bc02d5567c9d293f42ed289c32bf.tar.gz
cpython-394ee00993b5bc02d5567c9d293f42ed289c32bf.tar.bz2
remove usage of the deprecated max_buffer_size
Diffstat (limited to 'Lib')
-rw-r--r--Lib/_pyio.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/Lib/_pyio.py b/Lib/_pyio.py
index 0bb6c21..c6811db 100644
--- a/Lib/_pyio.py
+++ b/Lib/_pyio.py
@@ -971,9 +971,6 @@ class BufferedWriter(_BufferedIOMixin):
if buffer_size <= 0:
raise ValueError("invalid buffer size")
self.buffer_size = buffer_size
- self.max_buffer_size = (2*buffer_size
- if max_buffer_size is None
- else max_buffer_size)
self._write_buf = bytearray()
self._write_lock = Lock()
@@ -1000,12 +997,12 @@ class BufferedWriter(_BufferedIOMixin):
try:
self._flush_unlocked()
except BlockingIOError as e:
- if len(self._write_buf) > self.max_buffer_size:
- # We've hit max_buffer_size. We have to accept a
- # partial write and cut back our buffer.
- overage = len(self._write_buf) - self.max_buffer_size
+ if len(self._write_buf) > self.buffer_size:
+ # We've hit the buffer_size. We have to accept a partial
+ # write and cut back our buffer.
+ overage = len(self._write_buf) - self.buffer_size
written -= overage
- self._write_buf = self._write_buf[:self.max_buffer_size]
+ self._write_buf = self._write_buf[:self.buffer_size]
raise BlockingIOError(e.errno, e.strerror, written)
return written