Skip to content

Commit 8cba3bc

Browse files
authored
mypyc: use setuptools' distutils (#11306)
1 parent 461b4f1 commit 8cba3bc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

mypyc/build.py

+7
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@
4545
if TYPE_CHECKING:
4646
from distutils.core import Extension # noqa
4747

48+
try:
49+
# Import setuptools so that it monkey-patch overrides distutils
50+
import setuptools # type: ignore # noqa
51+
except ImportError:
52+
if sys.version_info >= (3, 12):
53+
# Raise on Python 3.12, since distutils will go away forever
54+
raise
4855
from distutils import sysconfig, ccompiler
4956

5057

0 commit comments

Comments
 (0)