[pypy-commit] pypy zlib-copying-third-time-a-charm: Immediately free the z_stream after flushing a decompressobj.

Julian Berman pypy.commits at gmail.com
Thu Feb 7 01:55:12 EST 2019


Author: Julian Berman <Julian+Hg at GrayVines.com>
Branch: zlib-copying-third-time-a-charm
Changeset: r95879:4ae1b51c0133
Date: 2019-02-07 07:53 +0100
http://bitbucket.org/pypy/pypy/changeset/4ae1b51c0133/

Log:	Immediately free the z_stream after flushing a decompressobj.

	Matches what CPython does, and doesn't wait for the finalizer, but
	more importantly will help us actually pass the lib-python test in a
	minute...

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
@@ -359,6 +359,9 @@
         else:
             string, finished, unused_len = result
             self._save_unconsumed_input(data, finished, unused_len)
+            if finished:
+                rzlib.inflateEnd(self.stream)
+                self.stream = rzlib.null_stream
         return space.newbytes(string)
 
 


More information about the pypy-commit mailing list