[pypy-commit] pypy py3.3: add ZLIB_RUNTIME_VERSION
pjenvey
noreply at buildbot.pypy.org
Fri Jan 2 22:29:46 CET 2015
Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3.3
Changeset: r75212:f7ed501c6405
Date: 2015-01-02 13:29 -0800
http://bitbucket.org/pypy/pypy/changeset/f7ed501c6405/
Log: add ZLIB_RUNTIME_VERSION
diff --git a/pypy/module/zlib/__init__.py b/pypy/module/zlib/__init__.py
--- a/pypy/module/zlib/__init__.py
+++ b/pypy/module/zlib/__init__.py
@@ -37,6 +37,12 @@
appleveldefs = {
}
+ def setup_after_space_initialization(self):
+ space = self.space
+ space.setattr(self, space.wrap('ZLIB_RUNTIME_VERSION'),
+ space.wrap(rzlib.zlibVersion()))
+
+
for _name in """
MAX_WBITS DEFLATED DEF_MEM_LEVEL
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
@@ -309,3 +309,7 @@
assert do.decompress(d0) == piece
do.decompress(d1) == piece[100:]
do.decompress(d2) == piece[:-100]
+
+ def test_version(self):
+ zlib = self.zlib
+ assert zlib.ZLIB_VERSION[0] == zlib.ZLIB_RUNTIME_VERSION[0]
More information about the pypy-commit
mailing list