summaryrefslogtreecommitdiff
path: root/setuptools/command/build_ext.py
diff options
context:
space:
mode:
authormergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-08-16 12:34:46 +0000
committerGitHub <noreply@github.com>2020-08-16 12:34:46 +0000
commitf991fbb3c9d0e10a0a78ae2b508b3fd99f9cdef2 (patch)
treea044b31a3276cc4a51b7fc23776a32b380562bad /setuptools/command/build_ext.py
parent4eb5b32f8d8bb1e20907028a516346e2b1901391 (diff)
parent45e0ea0ff10a64f315a5c65b6805327222e5b565 (diff)
downloadpython-setuptools-git-f991fbb3c9d0e10a0a78ae2b508b3fd99f9cdef2.tar.gz
Merge pull request #2332 from pypa/debt/cleanup-py2
Remove legacy Python 2 code
Diffstat (limited to 'setuptools/command/build_ext.py')
-rw-r--r--setuptools/command/build_ext.py16
1 files changed, 2 insertions, 14 deletions
diff --git a/setuptools/command/build_ext.py b/setuptools/command/build_ext.py
index 89a0e328..03a72b4f 100644
--- a/setuptools/command/build_ext.py
+++ b/setuptools/command/build_ext.py
@@ -1,6 +1,7 @@
import os
import sys
import itertools
+from importlib.machinery import EXTENSION_SUFFIXES
from distutils.command.build_ext import build_ext as _du_build_ext
from distutils.file_util import copy_file
from distutils.ccompiler import new_compiler
@@ -9,15 +10,6 @@ from distutils.errors import DistutilsError
from distutils import log
from setuptools.extension import Library
-from setuptools.extern import six
-
-if six.PY2:
- import imp
-
- EXTENSION_SUFFIXES = [
- s for s, _, tp in imp.get_suffixes() if tp == imp.C_EXTENSION]
-else:
- from importlib.machinery import EXTENSION_SUFFIXES
try:
# Attempt to use Cython for building extensions, if available
@@ -115,11 +107,7 @@ class build_ext(_build_ext):
filename = _build_ext.get_ext_filename(self, fullname)
if fullname in self.ext_map:
ext = self.ext_map[fullname]
- use_abi3 = (
- not six.PY2
- and getattr(ext, 'py_limited_api')
- and get_abi3_suffix()
- )
+ use_abi3 = getattr(ext, 'py_limited_api') and get_abi3_suffix()
if use_abi3:
so_ext = get_config_var('EXT_SUFFIX')
filename = filename[:-len(so_ext)]