Author: Armin Rigo <[email protected]>
Branch: use-gc-del-3
Changeset: r84249:b075b2f93078
Date: 2016-05-06 09:22 +0200
http://bitbucket.org/pypy/pypy/changeset/b075b2f93078/
Log: Fix zlib
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
@@ -148,8 +148,9 @@
raise zlib_error(space, e.msg)
except ValueError:
raise oefmt(space.w_ValueError, "Invalid initialization option")
+ self.register_finalizer(space)
- def __del__(self):
+ def _finalize_(self):
"""Automatically free the resources used by the stream."""
if self.stream:
rzlib.deflateEnd(self.stream)
@@ -258,8 +259,9 @@
raise zlib_error(space, e.msg)
except ValueError:
raise oefmt(space.w_ValueError, "Invalid initialization option")
+ self.register_finalizer(space)
- def __del__(self):
+ def _finalize_(self):
"""Automatically free the resources used by the stream."""
if self.stream:
rzlib.inflateEnd(self.stream)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit