[pypy-commit] cffi default: Correctly locate py2.7 debug build extensions

stefanor noreply at buildbot.pypy.org
Mon Jun 15 04:07:54 CEST 2015


Author: Stefano Rivera <stefano at rivera.za.net>
Branch: 
Changeset: r2185:78ba2e4ab0ff
Date: 2015-06-14 19:08 -0700
http://bitbucket.org/cffi/cffi/changeset/78ba2e4ab0ff/

Log:	Correctly locate py2.7 debug build extensions

diff --git a/testing/cffi1/test_zdist.py b/testing/cffi1/test_zdist.py
--- a/testing/cffi1/test_zdist.py
+++ b/testing/cffi1/test_zdist.py
@@ -59,7 +59,12 @@
             if (name.endswith('.so') or name.endswith('.pyd') or
                 name.endswith('.dylib')):
                 found_so = os.path.join(curdir, name)
-                name = name.split('.')[0] + '.SO' # foo.cpython-34m.so => foo.SO
+                # foo.cpython-34m.so => foo
+                name = name.split('.')[0]
+                # foo_d.so => foo (Python 2 debug builds)
+                if name.endswith('_d') and hasattr(sys, 'gettotalrefcount'):
+                    name = name.rsplit('_', 1)[0]
+                name += '.SO'
             if name.startswith('pycparser') and name.endswith('.egg'):
                 continue    # no clue why this shows up sometimes and not others
             assert name in content, "found unexpected file %r" % (


More information about the pypy-commit mailing list