Commit 2cde914c authored by Jason R. Coombs's avatar Jason R. Coombs

Use six for python major version detection

parent 097e92ab
import sys import sys
import distutils.command.build_ext as orig import distutils.command.build_ext as orig
from distutils.sysconfig import get_config_var from distutils.sysconfig import get_config_var
from setuptools.extern import six
from setuptools.command.build_ext import build_ext, get_abi3_suffix from setuptools.command.build_ext import build_ext, get_abi3_suffix
from setuptools.dist import Distribution from setuptools.dist import Distribution
from setuptools.extension import Extension from setuptools.extension import Extension
...@@ -35,7 +37,7 @@ class TestBuildExt: ...@@ -35,7 +37,7 @@ class TestBuildExt:
assert 'spam.eggs' in cmd.ext_map assert 'spam.eggs' in cmd.ext_map
res = cmd.get_ext_filename('spam.eggs') res = cmd.get_ext_filename('spam.eggs')
if sys.version_info[0] == 2 or not get_abi3_suffix(): if six.PY2 or not get_abi3_suffix():
assert res.endswith(get_config_var('SO')) assert res.endswith(get_config_var('SO'))
elif sys.platform == 'win32': elif sys.platform == 'win32':
assert res.endswith('eggs.pyd') assert res.endswith('eggs.pyd')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment