Author: Matti Picus <matti.pi...@gmail.com> Branch: Changeset: r87210:2b244ba62cf4 Date: 2016-09-18 23:27 +0300 http://bitbucket.org/pypy/pypy/changeset/2b244ba62cf4/
Log: PyPy creates a SOABI entry in confvars, Numpy needs only the correct SO entry The duplication of the functionality is from CPYthon, and so is the lack of tests :( 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 @@ -13,6 +13,7 @@ import sys import os import shlex +import imp from distutils.errors import DistutilsPlatformError @@ -62,8 +63,8 @@ """Initialize the module as appropriate for POSIX systems.""" g = {} g['EXE'] = "" - g['SO'] = ".so" - g['SOABI'] = g['SO'].rsplit('.')[0] + g['SOABI'] = [s[0] for s in imp.get_suffixes() if s[2] == imp.C_EXTENSION] + g['SO'] = g['SOABI'][0] g['LIBDIR'] = os.path.join(sys.prefix, 'lib') g['CC'] = "gcc -pthread" # -pthread might not be valid on OS/X, check @@ -75,8 +76,8 @@ """Initialize the module as appropriate for NT""" g = {} g['EXE'] = ".exe" - g['SO'] = ".pyd" - g['SOABI'] = g['SO'].rsplit('.')[0] + g['SOABI'] = [s[0] for s in imp.get_suffixes() if s[2] == imp.C_EXTENSION] + g['SO'] = g['SOABI'][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,10 +526,7 @@ # PyPy: import imp - for suffix, mode, type_ in imp.get_suffixes(): - if type_ == imp.C_EXTENSION: - _CONFIG_VARS['SOABI'] = suffix.split('.')[1] - break + _CONFIG_VARS['SOABI'] = [s[0] for s in imp.get_suffixes() if s[2] == imp.C_EXTENSION] if args: vals = [] _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit