aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-11-04 15:30:27 -0400
committerJason R. Coombs <jaraco@jaraco.com>2016-11-04 15:30:27 -0400
commit9e50e2e2e8920e31bab36855b5ddc48d4c474e95 (patch)
tree1303637ade17c55b365b7ca3feeb508a738d2aad
parent9fe9bb2536967161cebf3b4a71e34cd0699f37c9 (diff)
downloadexternal_python_setuptools-9e50e2e2e8920e31bab36855b5ddc48d4c474e95.tar.gz
external_python_setuptools-9e50e2e2e8920e31bab36855b5ddc48d4c474e95.tar.bz2
external_python_setuptools-9e50e2e2e8920e31bab36855b5ddc48d4c474e95.zip
Extract a helper to capture the temporary workaround. Ref #837.
-rw-r--r--setuptools/command/build_ext.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/setuptools/command/build_ext.py b/setuptools/command/build_ext.py
index 66ed285e..36f53f0d 100644
--- a/setuptools/command/build_ext.py
+++ b/setuptools/command/build_ext.py
@@ -109,7 +109,7 @@ class build_ext(_build_ext):
and get_abi3_suffix()
)
if use_abi3:
- so_ext = get_config_var('EXT_SUFFIX') or get_config_var('SO')
+ so_ext = _get_config_var_837('EXT_SUFFIX')
filename = filename[:-len(so_ext)]
filename = filename + get_abi3_suffix()
if isinstance(ext, Library):
@@ -316,3 +316,13 @@ else:
self.create_static_lib(
objects, basename, output_dir, debug, target_lang
)
+
+
+def _get_config_var_837(name):
+ """
+ In https://github.com/pypa/setuptools/pull/837, we discovered
+ Python 3.3.0 exposes the extension suffix under the name 'SO'.
+ """
+ if sys.version_info < (3, 3, 1):
+ name = 'SO'
+ return get_config_var(name)