mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
BZ2File now uses the compresslevel argument given by the caller,
instead of ignoring it and always using a compression level of 9.
This commit is contained in:
parent
c92f6226d7
commit
249ab5e8d1
2 changed files with 9 additions and 2 deletions
|
@ -75,11 +75,11 @@ class BZ2File(io.BufferedIOBase):
|
|||
elif mode in ("w", "wb"):
|
||||
mode = "wb"
|
||||
mode_code = _MODE_WRITE
|
||||
self._compressor = BZ2Compressor()
|
||||
self._compressor = BZ2Compressor(compresslevel)
|
||||
elif mode in ("a", "ab"):
|
||||
mode = "ab"
|
||||
mode_code = _MODE_WRITE
|
||||
self._compressor = BZ2Compressor()
|
||||
self._compressor = BZ2Compressor(compresslevel)
|
||||
else:
|
||||
raise ValueError("Invalid mode: {!r}".format(mode))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue