Skip to content

Commit f989d08

Browse files
committed
gh-107603: AC only includes pycore_gc.h if needed
Argument Clinic now only includes pycore_gc.h if PyGC_Head is needed, and only includes pycore_runtime.h if _Py_ID() is needed. Add Py_ARGUMENT_CLINIC_AVOID_INTERNAL_CAPI macro to opt-out for the internal C API in Argument Clinic. The following extensions avoids the internal C API by defining the macro Py_ARGUMENT_CLINIC_AVOID_INTERNAL_CAPI: * Modules/_csv.c * Modules/_multiprocessing/posixshmem.c * Modules/_testcapi/exceptions.c * Modules/_testinternalcapi.c * Modules/_testmultiphase.c * Modules/grpmodule.c * Modules/syslogmodule.c On Windows, the _testinternalcapi and _testmultiphase extensions are built as shared extensions which cannot use the _Py_ID() API. Accessing _PyRuntime members is not possible in a static _PyArg_Parser variable, it's not a "constant".
1 parent bd58389 commit f989d08

File tree

142 files changed

+410
-3874
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+410
-3874
lines changed

Include/internal/pycore_global_objects_fini_generated.h

Lines changed: 0 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_global_strings.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ struct _Py_global_strings {
282282
STRUCT_FOR_ID(argv)
283283
STRUCT_FOR_ID(as_integer_ratio)
284284
STRUCT_FOR_ID(asend)
285-
STRUCT_FOR_ID(ast)
286285
STRUCT_FOR_ID(athrow)
287286
STRUCT_FOR_ID(attribute)
288287
STRUCT_FOR_ID(authorizer_callback)
@@ -347,8 +346,6 @@ struct _Py_global_strings {
347346
STRUCT_FOR_ID(code)
348347
STRUCT_FOR_ID(command)
349348
STRUCT_FOR_ID(comment_factory)
350-
STRUCT_FOR_ID(compile_mode)
351-
STRUCT_FOR_ID(consts)
352349
STRUCT_FOR_ID(context)
353350
STRUCT_FOR_ID(contravariant)
354351
STRUCT_FOR_ID(cookie)
@@ -408,7 +405,6 @@ struct _Py_global_strings {
408405
STRUCT_FOR_ID(extend)
409406
STRUCT_FOR_ID(extra_tokens)
410407
STRUCT_FOR_ID(f)
411-
STRUCT_FOR_ID(facility)
412408
STRUCT_FOR_ID(factory)
413409
STRUCT_FOR_ID(false)
414410
STRUCT_FOR_ID(family)
@@ -460,8 +456,6 @@ struct _Py_global_strings {
460456
STRUCT_FOR_ID(headers)
461457
STRUCT_FOR_ID(hi)
462458
STRUCT_FOR_ID(hook)
463-
STRUCT_FOR_ID(id)
464-
STRUCT_FOR_ID(ident)
465459
STRUCT_FOR_ID(ignore)
466460
STRUCT_FOR_ID(imag)
467461
STRUCT_FOR_ID(importlib)
@@ -479,7 +473,6 @@ struct _Py_global_strings {
479473
STRUCT_FOR_ID(input)
480474
STRUCT_FOR_ID(insert_comments)
481475
STRUCT_FOR_ID(insert_pis)
482-
STRUCT_FOR_ID(instructions)
483476
STRUCT_FOR_ID(intern)
484477
STRUCT_FOR_ID(intersection)
485478
STRUCT_FOR_ID(is_running)
@@ -524,7 +517,6 @@ struct _Py_global_strings {
524517
STRUCT_FOR_ID(lo)
525518
STRUCT_FOR_ID(locale)
526519
STRUCT_FOR_ID(locals)
527-
STRUCT_FOR_ID(logoption)
528520
STRUCT_FOR_ID(loop)
529521
STRUCT_FOR_ID(mapping)
530522
STRUCT_FOR_ID(match)
@@ -538,7 +530,6 @@ struct _Py_global_strings {
538530
STRUCT_FOR_ID(memlimit)
539531
STRUCT_FOR_ID(message)
540532
STRUCT_FOR_ID(metaclass)
541-
STRUCT_FOR_ID(metadata)
542533
STRUCT_FOR_ID(method)
543534
STRUCT_FOR_ID(mod)
544535
STRUCT_FOR_ID(mode)
@@ -560,11 +551,9 @@ struct _Py_global_strings {
560551
STRUCT_FOR_ID(narg)
561552
STRUCT_FOR_ID(ndigits)
562553
STRUCT_FOR_ID(new_file_name)
563-
STRUCT_FOR_ID(new_limit)
564554
STRUCT_FOR_ID(newline)
565555
STRUCT_FOR_ID(newlines)
566556
STRUCT_FOR_ID(next)
567-
STRUCT_FOR_ID(nlocals)
568557
STRUCT_FOR_ID(node_depth)
569558
STRUCT_FOR_ID(node_offset)
570559
STRUCT_FOR_ID(ns)
@@ -720,7 +709,6 @@ struct _Py_global_strings {
720709
STRUCT_FOR_ID(translate)
721710
STRUCT_FOR_ID(true)
722711
STRUCT_FOR_ID(truncate)
723-
STRUCT_FOR_ID(twice)
724712
STRUCT_FOR_ID(txt)
725713
STRUCT_FOR_ID(type)
726714
STRUCT_FOR_ID(type_params)

Include/internal/pycore_runtime_init_generated.h

Lines changed: 0 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_unicodeobject_generated.h

Lines changed: 0 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)