[pypy-commit] pypy default: revert 2b244ba62cf4, redo the distutils part to be cpython compliant (no SOABI)

mattip pypy.commits at gmail.com
Mon Sep 19 12:34:53 EDT 2016


Author: Matti Picus <matti.picus at gmail.com>
Branch: 
Changeset: r87233:71a05328d60c
Date: 2016-09-19 18:08 +0300
http://bitbucket.org/pypy/pypy/changeset/71a05328d60c/

Log:	revert 2b244ba62cf4, redo the distutils part to be cpython compliant
	(no SOABI)

diff --git a/lib-python/2.7/distutils/sysconfig_pypy.py b/lib-python/2.7/distutils/sysconfig_pypy.py
--- a/lib-python/2.7/distutils/sysconfig_pypy.py
+++ b/lib-python/2.7/distutils/sysconfig_pypy.py
@@ -63,8 +63,7 @@
     """Initialize the module as appropriate for POSIX systems."""
     g = {}
     g['EXE'] = ""
-    g['SOABI'] = [s[0] for s in imp.get_suffixes() if s[2] == imp.C_EXTENSION]
-    g['SO'] = g['SOABI'][0]
+    g['SO'] = [s[0] for s in imp.get_suffixes() if s[2] == imp.C_EXTENSION][0]
     g['LIBDIR'] = os.path.join(sys.prefix, 'lib')
     g['CC'] = "gcc -pthread" # -pthread might not be valid on OS/X, check
 
@@ -76,8 +75,7 @@
     """Initialize the module as appropriate for NT"""
     g = {}
     g['EXE'] = ".exe"
-    g['SOABI'] = [s[0] for s in imp.get_suffixes() if s[2] == imp.C_EXTENSION]
-    g['SO'] = g['SOABI'][0]
+    g['SO'] = [s[0] for s in imp.get_suffixes() if s[2] == imp.C_EXTENSION][0]
 
     global _config_vars
     _config_vars = g
diff --git a/lib-python/2.7/sysconfig.py b/lib-python/2.7/sysconfig.py
--- a/lib-python/2.7/sysconfig.py
+++ b/lib-python/2.7/sysconfig.py
@@ -526,7 +526,10 @@
 
         # PyPy:
         import imp
-        _CONFIG_VARS['SOABI'] = [s[0] for s in imp.get_suffixes() if s[2] == imp.C_EXTENSION]
+        for suffix, mode, type_ in imp.get_suffixes():
+            if type_ == imp.C_EXTENSION:
+                _CONFIG_VARS['SOABI'] = suffix.split('.')[1]
+                break        
 
     if args:
         vals = []


More information about the pypy-commit mailing list