[pypy-svn] r78486 - pypy/branch/fast-forward/pypy/module/zlib

afa at codespeak.net afa at codespeak.net
Fri Oct 29 22:15:08 CEST 2010


Author: afa
Date: Fri Oct 29 22:15:05 2010
New Revision: 78486

Modified:
   pypy/branch/fast-forward/pypy/module/zlib/interp_zlib.py
Log:
Even it the decompressobj.flush() always returns "", mimic the checks done by CPython.


Modified: pypy/branch/fast-forward/pypy/module/zlib/interp_zlib.py
==============================================================================
--- pypy/branch/fast-forward/pypy/module/zlib/interp_zlib.py	(original)
+++ pypy/branch/fast-forward/pypy/module/zlib/interp_zlib.py	Fri Oct 29 22:15:05 2010
@@ -321,6 +321,9 @@
         because each call to decompress() immediately returns as much
         data as possible.
         """
+        if length <= 0:
+            raise OperationError(self.space.w_ValueError, self.space.wrap(
+                "length must be greater than zero"))
         # We could call rzlib.decompress(self.stream, '', rzlib.Z_FINISH)
         # which would complain if the input stream so far is not complete;
         # however CPython's zlib module does not behave like that.



More information about the Pypy-commit mailing list