[pypy-commit] pypy stdlib-2.7.13: decompressobj().flush() also accepts sys.maxint now
arigo
pypy.commits at gmail.com
Sun Dec 18 16:56:34 EST 2016
Author: Armin Rigo <arigo at tunes.org>
Branch: stdlib-2.7.13
Changeset: r89169:bf66e022e49c
Date: 2016-12-18 22:55 +0100
http://bitbucket.org/pypy/pypy/changeset/bf66e022e49c/
Log: decompressobj().flush() also accepts sys.maxint now
diff --git a/pypy/module/zlib/interp_zlib.py b/pypy/module/zlib/interp_zlib.py
--- a/pypy/module/zlib/interp_zlib.py
+++ b/pypy/module/zlib/interp_zlib.py
@@ -313,7 +313,7 @@
data as possible.
"""
if w_length is not None:
- length = space.c_int_w(w_length)
+ length = space.int_w(w_length)
if length <= 0:
raise oefmt(space.w_ValueError,
"length must be greater than zero")
diff --git a/pypy/module/zlib/test/test_zlib.py b/pypy/module/zlib/test/test_zlib.py
--- a/pypy/module/zlib/test/test_zlib.py
+++ b/pypy/module/zlib/test/test_zlib.py
@@ -135,7 +135,6 @@
"""
decompressor = self.zlib.decompressobj()
bytes = decompressor.decompress(self.compressed)
- raises(OverflowError, decompressor.flush, 2**31)
bytes += decompressor.flush()
assert bytes == self.expanded
@@ -165,10 +164,8 @@
raises(ValueError, zlib.decompressobj().flush, 0)
raises(ValueError, zlib.decompressobj().flush, -1)
raises(TypeError, zlib.decompressobj().flush, None)
- raises(OverflowError, zlib.decompressobj().flush, 2**31)
raises(ValueError, zlib.decompressobj().decompress, b'abc', -1)
raises(TypeError, zlib.decompressobj().decompress, b'abc', None)
- raises(OverflowError, zlib.decompressobj().decompress, b'abc', 2**31)
raises(TypeError, self.zlib.decompress, self.compressed, None)
raises(OverflowError, self.zlib.decompress, self.compressed, 2**31)
More information about the pypy-commit
mailing list