Skip to content

Commit

Permalink
Merge commit '6d7cc0ff9' into bugfix/distutils-6d7cc0ff9
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Mar 9, 2025
2 parents 0cffd61 + 6d7cc0f commit 149a28a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 2 additions & 0 deletions setuptools/_distutils/ccompiler.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from .compilers.C import base
from .compilers.C.base import (
CompileError,
LinkError,
gen_lib_options,
gen_preprocess_options,
get_default_compiler,
Expand All @@ -10,6 +11,7 @@

__all__ = [
'CompileError',
'LinkError',
'gen_lib_options',
'gen_preprocess_options',
'get_default_compiler',
Expand Down
9 changes: 1 addition & 8 deletions setuptools/_distutils/command/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from collections.abc import Sequence
from distutils._log import log

from ..ccompiler import CCompiler, CompileError, LinkError, new_compiler
from ..core import Command
from ..errors import DistutilsExecError
from ..sysconfig import customize_compiler
Expand Down Expand Up @@ -90,8 +91,6 @@ def _check_compiler(self):
"""
# We do this late, and only on-demand, because this is an expensive
# import.
from ..ccompiler import CCompiler, new_compiler

if not isinstance(self.compiler, CCompiler):
self.compiler = new_compiler(
compiler=self.compiler, dry_run=self.dry_run, force=True
Expand Down Expand Up @@ -177,8 +176,6 @@ def try_cpp(self, body=None, headers=None, include_dirs=None, lang="c"):
preprocessor succeeded, false if there were any errors.
('body' probably isn't of much use, but what the heck.)
"""
from ..ccompiler import CompileError

self._check_compiler()
ok = True
try:
Expand Down Expand Up @@ -213,8 +210,6 @@ def try_compile(self, body, headers=None, include_dirs=None, lang="c"):
"""Try to compile a source file built from 'body' and 'headers'.
Return true on success, false otherwise.
"""
from ..ccompiler import CompileError

self._check_compiler()
try:
self._compile(body, headers, include_dirs, lang)
Expand All @@ -239,8 +234,6 @@ def try_link(
'headers', to executable form. Return true on success, false
otherwise.
"""
from ..ccompiler import CompileError, LinkError

self._check_compiler()
try:
self._link(body, headers, include_dirs, libraries, library_dirs, lang)
Expand Down

0 comments on commit 149a28a

Please sign in to comment.