diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2012-07-07 15:03:22 (GMT) |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2012-07-07 15:03:22 (GMT) |
commit | 109d57358e9078fb1139e2b7687d7e300ce4dcb4 (patch) | |
tree | a485bc26bf29cad1d4e8b9c13c82ae09cab8235e /Lib/_pyio.py | |
parent | af1adbeedd9717fa8cfd47b3fa248a8169d7ef8e (diff) | |
download | cpython-109d57358e9078fb1139e2b7687d7e300ce4dcb4.zip cpython-109d57358e9078fb1139e2b7687d7e300ce4dcb4.tar.gz cpython-109d57358e9078fb1139e2b7687d7e300ce4dcb4.tar.bz2 |
Issue #13248: io: Remove obsolete argument "max_buffer_size" of BufferedWriter and BufferedRWPair.
Diffstat (limited to 'Lib/_pyio.py')
-rw-r--r-- | Lib/_pyio.py | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/Lib/_pyio.py b/Lib/_pyio.py index c06f4b8..1ce61e9 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -5,7 +5,6 @@ Python implementation of the io module. import os import abc import codecs -import warnings import errno # Import _thread instead of threading to reduce startup cost try: @@ -1065,19 +1064,13 @@ class BufferedWriter(_BufferedIOMixin): DEFAULT_BUFFER_SIZE. """ - _warning_stack_offset = 2 - - def __init__(self, raw, - buffer_size=DEFAULT_BUFFER_SIZE, max_buffer_size=None): + def __init__(self, raw, buffer_size=DEFAULT_BUFFER_SIZE): if not raw.writable(): raise IOError('"raw" argument must be writable.') _BufferedIOMixin.__init__(self, raw) if buffer_size <= 0: raise ValueError("invalid buffer size") - if max_buffer_size is not None: - warnings.warn("max_buffer_size is deprecated", DeprecationWarning, - self._warning_stack_offset) self.buffer_size = buffer_size self._write_buf = bytearray() self._write_lock = Lock() @@ -1167,15 +1160,11 @@ class BufferedRWPair(BufferedIOBase): # XXX The usefulness of this (compared to having two separate IO # objects) is questionable. - def __init__(self, reader, writer, - buffer_size=DEFAULT_BUFFER_SIZE, max_buffer_size=None): + def __init__(self, reader, writer, buffer_size=DEFAULT_BUFFER_SIZE): """Constructor. The arguments are two RawIO instances. """ - if max_buffer_size is not None: - warnings.warn("max_buffer_size is deprecated", DeprecationWarning, 2) - if not reader.readable(): raise IOError('"reader" argument must be readable.') @@ -1232,13 +1221,10 @@ class BufferedRandom(BufferedWriter, BufferedReader): defaults to DEFAULT_BUFFER_SIZE. """ - _warning_stack_offset = 3 - - def __init__(self, raw, - buffer_size=DEFAULT_BUFFER_SIZE, max_buffer_size=None): + def __init__(self, raw, buffer_size=DEFAULT_BUFFER_SIZE): raw._checkSeekable() BufferedReader.__init__(self, raw, buffer_size) - BufferedWriter.__init__(self, raw, buffer_size, max_buffer_size) + BufferedWriter.__init__(self, raw, buffer_size) def seek(self, pos, whence=0): if whence not in valid_seek_flags: |