Skip to content

Commit bcbad3a

Browse files
authored
Merge pull request pypa/distutils#346 from ManiacDC/add-back-ccompiler._default_compilers
Restores _default_compilers to ccompilers.py for backwards compatibility
2 parents fee62ca + b48a3b8 commit bcbad3a

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

distutils/ccompiler.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
from .compat.numpy import ( # noqa: F401
2+
_default_compilers,
3+
compiler_class,
4+
)
15
from .compilers.C import base
26
from .compilers.C.base import (
3-
compiler_class,
47
gen_lib_options,
58
gen_preprocess_options,
69
get_default_compiler,
@@ -12,7 +15,6 @@
1215
__all__ = [
1316
'CompileError',
1417
'LinkError',
15-
'compiler_class',
1618
'gen_lib_options',
1719
'gen_preprocess_options',
1820
'get_default_compiler',

distutils/compat/numpy.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# required for older numpy versions on Pythons prior to 3.12; see pypa/setuptools#4876
2+
from ..compilers.C.base import _default_compilers, compiler_class # noqa: F401

newsfragments/4876.bugfix.2.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Restore `distutils.ccompiler._default_compilers` -- by :user:`ManiacDC`

0 commit comments

Comments
 (0)