Skip to content

Commit 149a28a

Browse files
committed
Merge commit '6d7cc0ff9' into bugfix/distutils-6d7cc0ff9
2 parents 0cffd61 + 6d7cc0f commit 149a28a

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

setuptools/_distutils/ccompiler.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from .compilers.C import base
22
from .compilers.C.base import (
33
CompileError,
4+
LinkError,
45
gen_lib_options,
56
gen_preprocess_options,
67
get_default_compiler,
@@ -10,6 +11,7 @@
1011

1112
__all__ = [
1213
'CompileError',
14+
'LinkError',
1315
'gen_lib_options',
1416
'gen_preprocess_options',
1517
'get_default_compiler',

setuptools/_distutils/command/config.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from collections.abc import Sequence
1818
from distutils._log import log
1919

20+
from ..ccompiler import CCompiler, CompileError, LinkError, new_compiler
2021
from ..core import Command
2122
from ..errors import DistutilsExecError
2223
from ..sysconfig import customize_compiler
@@ -90,8 +91,6 @@ def _check_compiler(self):
9091
"""
9192
# We do this late, and only on-demand, because this is an expensive
9293
# import.
93-
from ..ccompiler import CCompiler, new_compiler
94-
9594
if not isinstance(self.compiler, CCompiler):
9695
self.compiler = new_compiler(
9796
compiler=self.compiler, dry_run=self.dry_run, force=True
@@ -177,8 +176,6 @@ def try_cpp(self, body=None, headers=None, include_dirs=None, lang="c"):
177176
preprocessor succeeded, false if there were any errors.
178177
('body' probably isn't of much use, but what the heck.)
179178
"""
180-
from ..ccompiler import CompileError
181-
182179
self._check_compiler()
183180
ok = True
184181
try:
@@ -213,8 +210,6 @@ def try_compile(self, body, headers=None, include_dirs=None, lang="c"):
213210
"""Try to compile a source file built from 'body' and 'headers'.
214211
Return true on success, false otherwise.
215212
"""
216-
from ..ccompiler import CompileError
217-
218213
self._check_compiler()
219214
try:
220215
self._compile(body, headers, include_dirs, lang)
@@ -239,8 +234,6 @@ def try_link(
239234
'headers', to executable form. Return true on success, false
240235
otherwise.
241236
"""
242-
from ..ccompiler import CompileError, LinkError
243-
244237
self._check_compiler()
245238
try:
246239
self._link(body, headers, include_dirs, libraries, library_dirs, lang)

0 commit comments

Comments
 (0)