Skip to content

Commit 64b134e

Browse files
committed
Use setuptools.command.build if available
1 parent 9ea5b7b commit 64b134e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

setup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,24 @@
2222
print("Value {} for USE_DISTUTILS treated as False".
2323
format(use_distutils))
2424

25-
from distutils.command.build import build as _build
26-
2725
if use_setuptools:
2826
try:
2927
from setuptools import setup
3028
from setuptools.command.install import install as _install
3129
from setuptools.command.build_ext import build_ext as _build_ext
3230
except ImportError:
3331
use_setuptools = False
32+
else:
33+
try:
34+
from setuptools.command.build import build as _build
35+
except ImportError:
36+
from distutils.command.build import build as _build
3437

3538
if not use_setuptools:
3639
from distutils.core import setup
3740
from distutils.command.install import install as _install
3841
from distutils.command.build_ext import build_ext as _build_ext
42+
from distutils.command.build import build as _build
3943

4044
cmake_opts = [("PYTHON_BIN", sys.executable),
4145
("CMAKE_INSTALL_RPATH_USE_LINK_PATH", "yes")]

0 commit comments

Comments
 (0)