aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2016-09-18 23:27:21 +0300
committerMatti Picus <matti.picus@gmail.com>2016-09-18 23:27:21 +0300
commitb7afee302bfdee98af26ae4c8046a2f1b3031537 (patch)
tree126a71e55d1a1fba19385ed36afb0b3ab49ea46b /lib-python/2.7/distutils
parenttranslation fix (diff)
downloadpypy-b7afee302bfdee98af26ae4c8046a2f1b3031537.tar.gz
pypy-b7afee302bfdee98af26ae4c8046a2f1b3031537.tar.bz2
pypy-b7afee302bfdee98af26ae4c8046a2f1b3031537.zip
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 :(
Diffstat (limited to 'lib-python/2.7/distutils')
-rw-r--r--lib-python/2.7/distutils/sysconfig_pypy.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib-python/2.7/distutils/sysconfig_pypy.py b/lib-python/2.7/distutils/sysconfig_pypy.py
index b3ded93d09..04419fed07 100644
--- a/lib-python/2.7/distutils/sysconfig_pypy.py
+++ b/lib-python/2.7/distutils/sysconfig_pypy.py
@@ -13,6 +13,7 @@ __revision__ = "$Id: sysconfig.py 85358 2010-10-10 09:54:59Z antoine.pitrou $"
import sys
import os
import shlex
+import imp
from distutils.errors import DistutilsPlatformError
@@ -62,8 +63,8 @@ def _init_posix():
"""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 @@ def _init_nt():
"""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