Author: Matti Picus <[email protected]>
Branch:
Changeset: r96537:d0a7535c8be7
Date: 2019-04-22 21:19 +0300
http://bitbucket.org/pypy/pypy/changeset/d0a7535c8be7/
Log: mutiple flush calls do not raise on cpython
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
@@ -352,8 +352,7 @@
raise oefmt(space.w_ValueError,
"length must be greater than zero")
if not self.stream:
- raise zlib_error(space,
- "compressor object already flushed")
+ return space.newbytes('')
data = self.unconsumed_tail
try:
self.lock()
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
@@ -363,4 +363,5 @@
dco = zlib.decompressobj()
dco.decompress(x)
dco.flush()
- raises(self.zlib.error, dco.flush)
+ # multiple flush calls should not raise
+ dco.flush()
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit