[pypy-commit] cffi default: More careful, even if it looks more brittle in theory

arigo noreply at buildbot.pypy.org
Thu Feb 28 09:14:07 CET 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r1174:8bb28002f9d4
Date: 2013-02-28 09:13 +0100
http://bitbucket.org/cffi/cffi/changeset/8bb28002f9d4/

Log:	More careful, even if it looks more brittle in theory

diff --git a/cffi/verifier.py b/cffi/verifier.py
--- a/cffi/verifier.py
+++ b/cffi/verifier.py
@@ -73,8 +73,9 @@
         # kill both the .so extension and the other .'s, as introduced
         # by Python 3: 'basename.cpython-33m.so'
         basename = basename.split('.', 1)[0]
-        # and the _d added in Python 2 debug builds
-        if basename.endswith('_d'):
+        # and the _d added in Python 2 debug builds --- but try to be
+        # conservative and not kill a legitimate _d
+        if basename.endswith('_d') and hasattr(sys, 'gettotalrefcount'):
             basename = basename[:-2]
         return basename
 


More information about the pypy-commit mailing list