Skip to content

Commit 533a935

Browse files
committed
Inline the logger construction for compiler modules.
1 parent 0e968cf commit 533a935

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

distutils/compilers/C/base.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from __future__ import annotations
77

8+
import logging
89
import os
910
import pathlib
1011
import re
@@ -22,7 +23,6 @@
2223

2324
from more_itertools import always_iterable
2425

25-
from ..._log import log
2626
from ..._modified import newer_group
2727
from ...dir_util import mkpath
2828
from ...errors import (
@@ -48,6 +48,9 @@
4848
_BytesPathT = TypeVar("_BytesPathT", bound="bytes | os.PathLike[bytes]")
4949

5050

51+
log = logging.getLogger()
52+
53+
5154
class Compiler:
5255
"""Abstract base class to define the interface that must be implemented
5356
by real compiler classes. Also has some utility methods used by

distutils/compilers/C/msvc.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from __future__ import annotations
1515

1616
import contextlib
17+
import logging
1718
import os
1819
import subprocess
1920
import unittest.mock as mock
@@ -25,7 +26,6 @@
2526

2627
from itertools import count
2728

28-
from ..._log import log
2929
from ...errors import (
3030
DistutilsExecError,
3131
DistutilsPlatformError,
@@ -39,6 +39,8 @@
3939
LinkError,
4040
)
4141

42+
log = logging.getLogger()
43+
4244

4345
def _find_vc2015():
4446
try:

distutils/compilers/C/unix.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
from __future__ import annotations
1717

1818
import itertools
19+
import logging
1920
import os
2021
import re
2122
import shlex
2223
import sys
2324
from collections.abc import Iterable
2425

2526
from ... import sysconfig
26-
from ..._log import log
2727
from ..._macos_compat import compiler_fixup
2828
from ..._modified import newer
2929
from ...compat import consolidate_linker_args
@@ -36,6 +36,8 @@
3636
LinkError,
3737
)
3838

39+
log = logging.getLogger()
40+
3941
# XXX Things not currently handled:
4042
# * optimization/debug/warning flags; we just use whatever's in Python's
4143
# Makefile and live with it. Is this adequate? If not, we might

0 commit comments

Comments
 (0)