Skip to content

Commit 4b454ea

Browse files
committed
Remove conditional logic for unsupported setuptools versions
1 parent 727aa2d commit 4b454ea

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

setup.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,7 @@
55
from setuptools import Extension, setup
66
from setuptools.command.bdist_wheel import bdist_wheel
77
from setuptools.command.build_ext import build_ext
8-
9-
# These were only added to setuptools in 59.0.1.
10-
try:
11-
from setuptools.errors import (
12-
CCompilerError,
13-
DistutilsExecError,
14-
DistutilsPlatformError,
15-
)
16-
except ImportError:
17-
from distutils.errors import (
18-
CCompilerError,
19-
DistutilsExecError,
20-
DistutilsPlatformError,
21-
)
8+
from setuptools.errors import CCompilerError, ExecError, PlatformError
229

2310
cmdclass = {}
2411
PYPY = hasattr(sys, "pypy_version_info")
@@ -74,7 +61,7 @@
7461

7562
# Cargo cult code for installing extension with pure Python fallback.
7663
# Taken from SQLAlchemy, but this same basic code exists in many modules.
77-
ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError)
64+
ext_errors = (CCompilerError, ExecError, PlatformError)
7865

7966

8067
class BuildFailed(Exception):
@@ -88,7 +75,7 @@ class ve_build_ext(build_ext):
8875
def run(self) -> None:
8976
try:
9077
build_ext.run(self)
91-
except DistutilsPlatformError:
78+
except PlatformError:
9279
raise BuildFailed
9380

9481
def build_extension(self, ext) -> None:

0 commit comments

Comments
 (0)