Skip to content

Commit b8efef7

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/grpmodule.c * Modules/syslogmodule.c On Windows, the _testinternalcapi extension is built as a shared extension 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 b8efef7

File tree

141 files changed

+438
-3850
lines changed

Some content is hidden

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

141 files changed

+438
-3850
lines changed

Include/internal/pycore_global_objects_fini_generated.h

Lines changed: 5 additions & 10 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: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -276,13 +276,14 @@ struct _Py_global_strings {
276276
STRUCT_FOR_ID(after_in_child)
277277
STRUCT_FOR_ID(after_in_parent)
278278
STRUCT_FOR_ID(aggregate_class)
279+
STRUCT_FOR_ID(alias)
279280
STRUCT_FOR_ID(append)
280281
STRUCT_FOR_ID(argdefs)
282+
STRUCT_FOR_ID(args)
281283
STRUCT_FOR_ID(arguments)
282284
STRUCT_FOR_ID(argv)
283285
STRUCT_FOR_ID(as_integer_ratio)
284286
STRUCT_FOR_ID(asend)
285-
STRUCT_FOR_ID(ast)
286287
STRUCT_FOR_ID(athrow)
287288
STRUCT_FOR_ID(attribute)
288289
STRUCT_FOR_ID(authorizer_callback)
@@ -347,8 +348,6 @@ struct _Py_global_strings {
347348
STRUCT_FOR_ID(code)
348349
STRUCT_FOR_ID(command)
349350
STRUCT_FOR_ID(comment_factory)
350-
STRUCT_FOR_ID(compile_mode)
351-
STRUCT_FOR_ID(consts)
352351
STRUCT_FOR_ID(context)
353352
STRUCT_FOR_ID(contravariant)
354353
STRUCT_FOR_ID(cookie)
@@ -401,14 +400,15 @@ struct _Py_global_strings {
401400
STRUCT_FOR_ID(errors)
402401
STRUCT_FOR_ID(event)
403402
STRUCT_FOR_ID(eventmask)
403+
STRUCT_FOR_ID(exc_type)
404+
STRUCT_FOR_ID(exc_value)
404405
STRUCT_FOR_ID(excepthook)
405406
STRUCT_FOR_ID(exception)
406407
STRUCT_FOR_ID(existing_file_name)
407408
STRUCT_FOR_ID(exp)
408409
STRUCT_FOR_ID(extend)
409410
STRUCT_FOR_ID(extra_tokens)
410411
STRUCT_FOR_ID(f)
411-
STRUCT_FOR_ID(facility)
412412
STRUCT_FOR_ID(factory)
413413
STRUCT_FOR_ID(false)
414414
STRUCT_FOR_ID(family)
@@ -461,7 +461,6 @@ struct _Py_global_strings {
461461
STRUCT_FOR_ID(hi)
462462
STRUCT_FOR_ID(hook)
463463
STRUCT_FOR_ID(id)
464-
STRUCT_FOR_ID(ident)
465464
STRUCT_FOR_ID(ignore)
466465
STRUCT_FOR_ID(imag)
467466
STRUCT_FOR_ID(importlib)
@@ -479,7 +478,6 @@ struct _Py_global_strings {
479478
STRUCT_FOR_ID(input)
480479
STRUCT_FOR_ID(insert_comments)
481480
STRUCT_FOR_ID(insert_pis)
482-
STRUCT_FOR_ID(instructions)
483481
STRUCT_FOR_ID(intern)
484482
STRUCT_FOR_ID(intersection)
485483
STRUCT_FOR_ID(is_running)
@@ -524,7 +522,6 @@ struct _Py_global_strings {
524522
STRUCT_FOR_ID(lo)
525523
STRUCT_FOR_ID(locale)
526524
STRUCT_FOR_ID(locals)
527-
STRUCT_FOR_ID(logoption)
528525
STRUCT_FOR_ID(loop)
529526
STRUCT_FOR_ID(mapping)
530527
STRUCT_FOR_ID(match)
@@ -538,7 +535,6 @@ struct _Py_global_strings {
538535
STRUCT_FOR_ID(memlimit)
539536
STRUCT_FOR_ID(message)
540537
STRUCT_FOR_ID(metaclass)
541-
STRUCT_FOR_ID(metadata)
542538
STRUCT_FOR_ID(method)
543539
STRUCT_FOR_ID(mod)
544540
STRUCT_FOR_ID(mode)
@@ -560,11 +556,9 @@ struct _Py_global_strings {
560556
STRUCT_FOR_ID(narg)
561557
STRUCT_FOR_ID(ndigits)
562558
STRUCT_FOR_ID(new_file_name)
563-
STRUCT_FOR_ID(new_limit)
564559
STRUCT_FOR_ID(newline)
565560
STRUCT_FOR_ID(newlines)
566561
STRUCT_FOR_ID(next)
567-
STRUCT_FOR_ID(nlocals)
568562
STRUCT_FOR_ID(node_depth)
569563
STRUCT_FOR_ID(node_offset)
570564
STRUCT_FOR_ID(ns)
@@ -716,6 +710,7 @@ struct _Py_global_strings {
716710
STRUCT_FOR_ID(timetuple)
717711
STRUCT_FOR_ID(top)
718712
STRUCT_FOR_ID(trace_callback)
713+
STRUCT_FOR_ID(traceback)
719714
STRUCT_FOR_ID(trailers)
720715
STRUCT_FOR_ID(translate)
721716
STRUCT_FOR_ID(true)

Include/internal/pycore_runtime_init_generated.h

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

0 commit comments

Comments
 (0)