Skip to content

Commit cac3f31

Browse files
committed
Review conf_output.py: fix warning/notice functions and add missing notices.
- Use pyconf.warn() for AC_MSG_WARN (pkg-config, support tier) instead of warnings.warn(); use pyconf.notice() for AC_MSG_NOTICE (stdatomic.h) instead of print(). - Add missing pyconf.notice() calls for "creating Modules/Setup.local" and "creating Makefile" to match configure.ac lines 8365 and 8371. - Add docstring to generate_output(); remove unused import warnings. Assisted-by: Claude
1 parent f164fa2 commit cac3f31

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Tools/configure/conf_output.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88

99
from __future__ import annotations
1010

11-
import warnings
12-
1311
import pyconf
1412

1513

1614
def generate_output(v):
15+
"""Generate all output files and emit post-configuration warnings."""
1716
# ---------------------------------------------------------------------------
1817
# Generate output files (AC_CONFIG_FILES / AC_OUTPUT)
1918
# ---------------------------------------------------------------------------
@@ -41,6 +40,7 @@ def generate_output(v):
4140
# ---------------------------------------------------------------------------
4241

4342
if not pyconf.no_create:
43+
pyconf.notice("creating Modules/Setup.local")
4444
if not pyconf.path_exists("Modules/Setup.local"):
4545
pyconf.write_file(
4646
"Modules/Setup.local",
@@ -50,7 +50,7 @@ def generate_output(v):
5050
# Use the srcdir substitution value (e.g. "." for in-place,
5151
# absolute path for out-of-tree) to match autoconf behaviour.
5252
srcdir_rel = v.srcdir or "."
53-
# creating Makefile (via makesetup)
53+
pyconf.notice("creating Makefile")
5454
if not pyconf.cmd(
5555
[
5656
"/bin/sh",
@@ -70,7 +70,7 @@ def generate_output(v):
7070
pyconf.rename_file("config.c", "Modules/config.c")
7171

7272
if not v.PKG_CONFIG:
73-
warnings.warn(
73+
pyconf.warn(
7474
"pkg-config is missing. Some dependencies may not be detected correctly."
7575
)
7676

@@ -83,13 +83,13 @@ def generate_output(v):
8383
if v.PY_SUPPORT_TIER == 0:
8484
cc = v.ac_cv_cc_name
8585
host = v.host
86-
warnings.warn(
86+
pyconf.warn(
8787
f'Platform "{host}" with compiler "{cc}" is not supported by the '
8888
"CPython core team, see https://peps.python.org/pep-0011/ for more information."
8989
)
9090

9191
if not v.ac_cv_header_stdatomic_h:
92-
print(
92+
pyconf.notice(
9393
"Your compiler or platform does not have a working C11 stdatomic.h. "
9494
"A future version of Python may require stdatomic.h."
9595
)

0 commit comments

Comments
 (0)