summaryrefslogtreecommitdiffstats
path: root/Lib/bz2.py
diff options
context:
space:
mode:
authorNadeem Vawda <nadeem.vawda@gmail.com>2011-09-11 20:38:11 (GMT)
committerNadeem Vawda <nadeem.vawda@gmail.com>2011-09-11 20:38:11 (GMT)
commit249ab5e8d1452ab7bc43b0f1e1221e0065d2e52d (patch)
tree6ebff12b415d2245e019902ec858a4b946098282 /Lib/bz2.py
parentc92f6226d7e83a93a8ab535d3e964ae50c2c5272 (diff)
downloadcpython-249ab5e8d1452ab7bc43b0f1e1221e0065d2e52d.zip
cpython-249ab5e8d1452ab7bc43b0f1e1221e0065d2e52d.tar.gz
cpython-249ab5e8d1452ab7bc43b0f1e1221e0065d2e52d.tar.bz2
BZ2File now uses the compresslevel argument given by the caller,
instead of ignoring it and always using a compression level of 9.
Diffstat (limited to 'Lib/bz2.py')
-rw-r--r--Lib/bz2.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/bz2.py b/Lib/bz2.py
index cc71ae0..cbf5233 100644
--- a/Lib/bz2.py
+++ b/Lib/bz2.py
@@ -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))