From 750b40b89c254b5fa1a7e825edec780d04210256 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 31 Aug 2023 11:17:47 +0200 Subject: [PATCH] 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 * PC/_testconsole.c On Windows, the _testinternalcapi, _testmultiphase and _testconsole 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". --- .../pycore_global_objects_fini_generated.h | 13 - Include/internal/pycore_global_strings.h | 13 - .../internal/pycore_runtime_init_generated.h | 13 - .../internal/pycore_unicodeobject_generated.h | 39 -- Lib/test/clinic.test.c | 248 +------- Lib/test/test_clinic.py | 24 +- Modules/_blake2/clinic/blake2b_impl.c.h | 15 +- Modules/_blake2/clinic/blake2s_impl.c.h | 15 +- Modules/_csv.c | 3 + Modules/_ctypes/clinic/callproc.c.h | 8 +- Modules/_io/clinic/_iomodule.c.h | 21 +- Modules/_io/clinic/bufferedio.c.h | 27 +- Modules/_io/clinic/bytesio.c.h | 15 +- Modules/_io/clinic/fileio.c.h | 15 +- Modules/_io/clinic/iobase.c.h | 7 +- Modules/_io/clinic/stringio.c.h | 15 +- Modules/_io/clinic/textio.c.h | 33 +- Modules/_io/clinic/winconsoleio.c.h | 15 +- .../clinic/multiprocessing.c.h | 8 +- .../_multiprocessing/clinic/posixshmem.c.h | 44 +- Modules/_multiprocessing/clinic/semaphore.c.h | 27 +- Modules/_multiprocessing/posixshmem.c | 3 + Modules/_sqlite/clinic/_sqlite3.connect.c.h | 9 +- Modules/_sqlite/clinic/blob.c.h | 8 +- Modules/_sqlite/clinic/connection.c.h | 81 +-- Modules/_sqlite/clinic/cursor.c.h | 15 +- Modules/_sqlite/clinic/module.c.h | 15 +- Modules/_sqlite/clinic/row.c.h | 8 +- Modules/_sre/clinic/sre.c.h | 87 +-- Modules/_ssl/clinic/cert.c.h | 15 +- Modules/_testcapi/clinic/exceptions.c.h | 26 +- Modules/_testcapi/clinic/float.c.h | 8 +- Modules/_testcapi/clinic/long.c.h | 8 +- Modules/_testcapi/clinic/vectorcall.c.h | 8 +- Modules/_testcapi/clinic/watchers.c.h | 8 +- Modules/_testcapi/exceptions.c | 3 + Modules/_testinternalcapi.c | 6 +- Modules/_testmultiphase.c | 4 + Modules/cjkcodecs/clinic/multibytecodec.c.h | 33 +- Modules/clinic/_abc.c.h | 8 +- Modules/clinic/_asynciomodule.c.h | 99 +-- Modules/clinic/_bisectmodule.c.h | 33 +- Modules/clinic/_bz2module.c.h | 15 +- Modules/clinic/_codecsmodule.c.h | 21 +- Modules/clinic/_collectionsmodule.c.h | 7 +- Modules/clinic/_contextvarsmodule.c.h | 8 +- Modules/clinic/_csv.c.h | 62 +- Modules/clinic/_curses_panel.c.h | 8 +- Modules/clinic/_cursesmodule.c.h | 15 +- Modules/clinic/_datetimemodule.c.h | 21 +- Modules/clinic/_dbmmodule.c.h | 8 +- Modules/clinic/_elementtree.c.h | 57 +- Modules/clinic/_functoolsmodule.c.h | 15 +- Modules/clinic/_gdbmmodule.c.h | 8 +- Modules/clinic/_hashopenssl.c.h | 129 +--- Modules/clinic/_heapqmodule.c.h | 8 +- Modules/clinic/_localemodule.c.h | 8 +- Modules/clinic/_lsprof.c.h | 8 +- Modules/clinic/_lzmamodule.c.h | 21 +- Modules/clinic/_opcode.c.h | 63 +- Modules/clinic/_operator.c.h | 7 +- Modules/clinic/_pickle.c.h | 45 +- Modules/clinic/_posixsubprocess.c.h | 8 +- Modules/clinic/_queuemodule.c.h | 27 +- Modules/clinic/_randommodule.c.h | 8 +- Modules/clinic/_ssl.c.h | 63 +- Modules/clinic/_statisticsmodule.c.h | 8 +- Modules/clinic/_struct.c.h | 27 +- Modules/clinic/_testclinic.c.h | 165 +---- Modules/clinic/_testclinic_depr.c.h | 177 +----- Modules/clinic/_testinternalcapi.c.h | 80 +-- Modules/clinic/_testmultiphase.c.h | 26 +- Modules/clinic/_tkinter.c.h | 8 +- Modules/clinic/_tracemalloc.c.h | 8 +- Modules/clinic/_typingmodule.c.h | 8 +- Modules/clinic/_weakref.c.h | 8 +- Modules/clinic/_winapi.c.h | 51 +- Modules/clinic/_zoneinfo.c.h | 27 +- Modules/clinic/arraymodule.c.h | 7 +- Modules/clinic/binascii.c.h | 51 +- Modules/clinic/cmathmodule.c.h | 15 +- Modules/clinic/fcntlmodule.c.h | 7 +- Modules/clinic/gcmodule.c.h | 21 +- Modules/clinic/grpmodule.c.h | 44 +- Modules/clinic/itertoolsmodule.c.h | 57 +- Modules/clinic/mathmodule.c.h | 27 +- Modules/clinic/md5module.c.h | 15 +- Modules/clinic/overlapped.c.h | 15 +- Modules/clinic/posixmodule.c.h | 579 +----------------- Modules/clinic/pwdmodule.c.h | 8 +- Modules/clinic/pyexpat.c.h | 15 +- Modules/clinic/readline.c.h | 8 +- Modules/clinic/resource.c.h | 8 +- Modules/clinic/selectmodule.c.h | 39 +- Modules/clinic/sha1module.c.h | 15 +- Modules/clinic/sha2module.c.h | 33 +- Modules/clinic/sha3module.c.h | 15 +- Modules/clinic/signalmodule.c.h | 8 +- Modules/clinic/socketmodule.c.h | 15 +- Modules/clinic/symtablemodule.c.h | 8 +- Modules/clinic/syslogmodule.c.h | 26 +- Modules/clinic/termios.c.h | 7 +- Modules/clinic/unicodedata.c.h | 8 +- Modules/clinic/zlibmodule.c.h | 45 +- Modules/grpmodule.c | 3 + Modules/syslogmodule.c | 3 + Objects/clinic/bytearrayobject.c.h | 51 +- Objects/clinic/bytesobject.c.h | 51 +- Objects/clinic/classobject.c.h | 8 +- Objects/clinic/codeobject.c.h | 21 +- Objects/clinic/complexobject.c.h | 15 +- Objects/clinic/descrobject.c.h | 21 +- Objects/clinic/dictobject.c.h | 8 +- Objects/clinic/enumobject.c.h | 15 +- Objects/clinic/floatobject.c.h | 8 +- Objects/clinic/funcobject.c.h | 15 +- Objects/clinic/listobject.c.h | 15 +- Objects/clinic/longobject.c.h | 27 +- Objects/clinic/memoryobject.c.h | 39 +- Objects/clinic/moduleobject.c.h | 15 +- Objects/clinic/odictobject.c.h | 39 +- Objects/clinic/structseq.c.h | 15 +- Objects/clinic/tupleobject.c.h | 8 +- Objects/clinic/typeobject.c.h | 8 +- Objects/clinic/typevarobject.c.h | 45 +- Objects/clinic/unicodeobject.c.h | 51 +- Objects/stringlib/clinic/transmogrify.h.h | 15 +- PC/_testconsole.c | 4 + PC/clinic/_testconsole.c.h | 44 +- PC/clinic/_wmimodule.cpp.h | 15 +- PC/clinic/msvcrtmodule.c.h | 8 +- PC/clinic/winreg.c.h | 33 +- PC/clinic/winsound.c.h | 27 +- Python/clinic/Python-tokenize.c.h | 15 +- Python/clinic/_warnings.c.h | 21 +- Python/clinic/bltinmodule.c.h | 51 +- Python/clinic/context.c.h | 8 +- Python/clinic/import.c.h | 21 +- Python/clinic/instrumentation.c.h | 8 +- Python/clinic/marshal.c.h | 8 +- Python/clinic/sysmodule.c.h | 33 +- Python/clinic/traceback.c.h | 15 +- Tools/clinic/clinic.py | 78 ++- 143 files changed, 414 insertions(+), 3903 deletions(-) diff --git a/Include/internal/pycore_global_objects_fini_generated.h b/Include/internal/pycore_global_objects_fini_generated.h index 6361f5d1100231e..f0ae3d38e930a4c 100644 --- a/Include/internal/pycore_global_objects_fini_generated.h +++ b/Include/internal/pycore_global_objects_fini_generated.h @@ -793,7 +793,6 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) { _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(argv)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(as_integer_ratio)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(asend)); - _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(ast)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(athrow)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(attribute)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(authorizer_callback)); @@ -858,8 +857,6 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) { _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(code)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(command)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(comment_factory)); - _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(compile_mode)); - _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(consts)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(context)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(contravariant)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(cookie)); @@ -919,7 +916,6 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) { _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(extend)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(extra_tokens)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(f)); - _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(facility)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(factory)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(false)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(family)); @@ -971,8 +967,6 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) { _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(headers)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(hi)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(hook)); - _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(id)); - _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(ident)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(ignore)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(imag)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(importlib)); @@ -990,7 +984,6 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) { _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(input)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(insert_comments)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(insert_pis)); - _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(instructions)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(intern)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(intersection)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(is_running)); @@ -1035,7 +1028,6 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) { _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(lo)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(locale)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(locals)); - _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(logoption)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(loop)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(mapping)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(match)); @@ -1049,7 +1041,6 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) { _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(memlimit)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(message)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(metaclass)); - _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(metadata)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(method)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(mod)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(mode)); @@ -1071,11 +1062,9 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) { _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(narg)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(ndigits)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(new_file_name)); - _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(new_limit)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(newline)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(newlines)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(next)); - _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(nlocals)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(node_depth)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(node_offset)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(ns)); @@ -1156,7 +1145,6 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) { _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(return)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(reverse)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(reversed)); - _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(s)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(salt)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(sched_priority)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(scheduler)); @@ -1231,7 +1219,6 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) { _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(translate)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(true)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(truncate)); - _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(twice)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(txt)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(type)); _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(type_params)); diff --git a/Include/internal/pycore_global_strings.h b/Include/internal/pycore_global_strings.h index 504008d67fe9cd7..620cd9b3b70280e 100644 --- a/Include/internal/pycore_global_strings.h +++ b/Include/internal/pycore_global_strings.h @@ -282,7 +282,6 @@ struct _Py_global_strings { STRUCT_FOR_ID(argv) STRUCT_FOR_ID(as_integer_ratio) STRUCT_FOR_ID(asend) - STRUCT_FOR_ID(ast) STRUCT_FOR_ID(athrow) STRUCT_FOR_ID(attribute) STRUCT_FOR_ID(authorizer_callback) @@ -347,8 +346,6 @@ struct _Py_global_strings { STRUCT_FOR_ID(code) STRUCT_FOR_ID(command) STRUCT_FOR_ID(comment_factory) - STRUCT_FOR_ID(compile_mode) - STRUCT_FOR_ID(consts) STRUCT_FOR_ID(context) STRUCT_FOR_ID(contravariant) STRUCT_FOR_ID(cookie) @@ -408,7 +405,6 @@ struct _Py_global_strings { STRUCT_FOR_ID(extend) STRUCT_FOR_ID(extra_tokens) STRUCT_FOR_ID(f) - STRUCT_FOR_ID(facility) STRUCT_FOR_ID(factory) STRUCT_FOR_ID(false) STRUCT_FOR_ID(family) @@ -460,8 +456,6 @@ struct _Py_global_strings { STRUCT_FOR_ID(headers) STRUCT_FOR_ID(hi) STRUCT_FOR_ID(hook) - STRUCT_FOR_ID(id) - STRUCT_FOR_ID(ident) STRUCT_FOR_ID(ignore) STRUCT_FOR_ID(imag) STRUCT_FOR_ID(importlib) @@ -479,7 +473,6 @@ struct _Py_global_strings { STRUCT_FOR_ID(input) STRUCT_FOR_ID(insert_comments) STRUCT_FOR_ID(insert_pis) - STRUCT_FOR_ID(instructions) STRUCT_FOR_ID(intern) STRUCT_FOR_ID(intersection) STRUCT_FOR_ID(is_running) @@ -524,7 +517,6 @@ struct _Py_global_strings { STRUCT_FOR_ID(lo) STRUCT_FOR_ID(locale) STRUCT_FOR_ID(locals) - STRUCT_FOR_ID(logoption) STRUCT_FOR_ID(loop) STRUCT_FOR_ID(mapping) STRUCT_FOR_ID(match) @@ -538,7 +530,6 @@ struct _Py_global_strings { STRUCT_FOR_ID(memlimit) STRUCT_FOR_ID(message) STRUCT_FOR_ID(metaclass) - STRUCT_FOR_ID(metadata) STRUCT_FOR_ID(method) STRUCT_FOR_ID(mod) STRUCT_FOR_ID(mode) @@ -560,11 +551,9 @@ struct _Py_global_strings { STRUCT_FOR_ID(narg) STRUCT_FOR_ID(ndigits) STRUCT_FOR_ID(new_file_name) - STRUCT_FOR_ID(new_limit) STRUCT_FOR_ID(newline) STRUCT_FOR_ID(newlines) STRUCT_FOR_ID(next) - STRUCT_FOR_ID(nlocals) STRUCT_FOR_ID(node_depth) STRUCT_FOR_ID(node_offset) STRUCT_FOR_ID(ns) @@ -645,7 +634,6 @@ struct _Py_global_strings { STRUCT_FOR_ID(return) STRUCT_FOR_ID(reverse) STRUCT_FOR_ID(reversed) - STRUCT_FOR_ID(s) STRUCT_FOR_ID(salt) STRUCT_FOR_ID(sched_priority) STRUCT_FOR_ID(scheduler) @@ -720,7 +708,6 @@ struct _Py_global_strings { STRUCT_FOR_ID(translate) STRUCT_FOR_ID(true) STRUCT_FOR_ID(truncate) - STRUCT_FOR_ID(twice) STRUCT_FOR_ID(txt) STRUCT_FOR_ID(type) STRUCT_FOR_ID(type_params) diff --git a/Include/internal/pycore_runtime_init_generated.h b/Include/internal/pycore_runtime_init_generated.h index 8cc3287ce35e5b7..406aedd672281ef 100644 --- a/Include/internal/pycore_runtime_init_generated.h +++ b/Include/internal/pycore_runtime_init_generated.h @@ -791,7 +791,6 @@ extern "C" { INIT_ID(argv), \ INIT_ID(as_integer_ratio), \ INIT_ID(asend), \ - INIT_ID(ast), \ INIT_ID(athrow), \ INIT_ID(attribute), \ INIT_ID(authorizer_callback), \ @@ -856,8 +855,6 @@ extern "C" { INIT_ID(code), \ INIT_ID(command), \ INIT_ID(comment_factory), \ - INIT_ID(compile_mode), \ - INIT_ID(consts), \ INIT_ID(context), \ INIT_ID(contravariant), \ INIT_ID(cookie), \ @@ -917,7 +914,6 @@ extern "C" { INIT_ID(extend), \ INIT_ID(extra_tokens), \ INIT_ID(f), \ - INIT_ID(facility), \ INIT_ID(factory), \ INIT_ID(false), \ INIT_ID(family), \ @@ -969,8 +965,6 @@ extern "C" { INIT_ID(headers), \ INIT_ID(hi), \ INIT_ID(hook), \ - INIT_ID(id), \ - INIT_ID(ident), \ INIT_ID(ignore), \ INIT_ID(imag), \ INIT_ID(importlib), \ @@ -988,7 +982,6 @@ extern "C" { INIT_ID(input), \ INIT_ID(insert_comments), \ INIT_ID(insert_pis), \ - INIT_ID(instructions), \ INIT_ID(intern), \ INIT_ID(intersection), \ INIT_ID(is_running), \ @@ -1033,7 +1026,6 @@ extern "C" { INIT_ID(lo), \ INIT_ID(locale), \ INIT_ID(locals), \ - INIT_ID(logoption), \ INIT_ID(loop), \ INIT_ID(mapping), \ INIT_ID(match), \ @@ -1047,7 +1039,6 @@ extern "C" { INIT_ID(memlimit), \ INIT_ID(message), \ INIT_ID(metaclass), \ - INIT_ID(metadata), \ INIT_ID(method), \ INIT_ID(mod), \ INIT_ID(mode), \ @@ -1069,11 +1060,9 @@ extern "C" { INIT_ID(narg), \ INIT_ID(ndigits), \ INIT_ID(new_file_name), \ - INIT_ID(new_limit), \ INIT_ID(newline), \ INIT_ID(newlines), \ INIT_ID(next), \ - INIT_ID(nlocals), \ INIT_ID(node_depth), \ INIT_ID(node_offset), \ INIT_ID(ns), \ @@ -1154,7 +1143,6 @@ extern "C" { INIT_ID(return), \ INIT_ID(reverse), \ INIT_ID(reversed), \ - INIT_ID(s), \ INIT_ID(salt), \ INIT_ID(sched_priority), \ INIT_ID(scheduler), \ @@ -1229,7 +1217,6 @@ extern "C" { INIT_ID(translate), \ INIT_ID(true), \ INIT_ID(truncate), \ - INIT_ID(twice), \ INIT_ID(txt), \ INIT_ID(type), \ INIT_ID(type_params), \ diff --git a/Include/internal/pycore_unicodeobject_generated.h b/Include/internal/pycore_unicodeobject_generated.h index 50400db2919a734..213a4294743e9c5 100644 --- a/Include/internal/pycore_unicodeobject_generated.h +++ b/Include/internal/pycore_unicodeobject_generated.h @@ -687,9 +687,6 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) { string = &_Py_ID(asend); assert(_PyUnicode_CheckConsistency(string, 1)); _PyUnicode_InternInPlace(interp, &string); - string = &_Py_ID(ast); - assert(_PyUnicode_CheckConsistency(string, 1)); - _PyUnicode_InternInPlace(interp, &string); string = &_Py_ID(athrow); assert(_PyUnicode_CheckConsistency(string, 1)); _PyUnicode_InternInPlace(interp, &string); @@ -882,12 +879,6 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) { string = &_Py_ID(comment_factory); assert(_PyUnicode_CheckConsistency(string, 1)); _PyUnicode_InternInPlace(interp, &string); - string = &_Py_ID(compile_mode); - assert(_PyUnicode_CheckConsistency(string, 1)); - _PyUnicode_InternInPlace(interp, &string); - string = &_Py_ID(consts); - assert(_PyUnicode_CheckConsistency(string, 1)); - _PyUnicode_InternInPlace(interp, &string); string = &_Py_ID(context); assert(_PyUnicode_CheckConsistency(string, 1)); _PyUnicode_InternInPlace(interp, &string); @@ -1065,9 +1056,6 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) { string = &_Py_ID(f); assert(_PyUnicode_CheckConsistency(string, 1)); _PyUnicode_InternInPlace(interp, &string); - string = &_Py_ID(facility); - assert(_PyUnicode_CheckConsistency(string, 1)); - _PyUnicode_InternInPlace(interp, &string); string = &_Py_ID(factory); assert(_PyUnicode_CheckConsistency(string, 1)); _PyUnicode_InternInPlace(interp, &string); @@ -1221,12 +1209,6 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) { string = &_Py_ID(hook); assert(_PyUnicode_CheckConsistency(string, 1)); _PyUnicode_InternInPlace(interp, &string); - string = &_Py_ID(id); - assert(_PyUnicode_CheckConsistency(string, 1)); - _PyUnicode_InternInPlace(interp, &string); - string = &_Py_ID(ident); - assert(_PyUnicode_CheckConsistency(string, 1)); - _PyUnicode_InternInPlace(interp, &string); string = &_Py_ID(ignore); assert(_PyUnicode_CheckConsistency(string, 1)); _PyUnicode_InternInPlace(interp, &string); @@ -1278,9 +1260,6 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) { string = &_Py_ID(insert_pis); assert(_PyUnicode_CheckConsistency(string, 1)); _PyUnicode_InternInPlace(interp, &string); - string = &_Py_ID(instructions); - assert(_PyUnicode_CheckConsistency(string, 1)); - _PyUnicode_InternInPlace(interp, &string); string = &_Py_ID(intern); assert(_PyUnicode_CheckConsistency(string, 1)); _PyUnicode_InternInPlace(interp, &string); @@ -1413,9 +1392,6 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) { string = &_Py_ID(locals); assert(_PyUnicode_CheckConsistency(string, 1)); _PyUnicode_InternInPlace(interp, &string); - string = &_Py_ID(logoption); - assert(_PyUnicode_CheckConsistency(string, 1)); - _PyUnicode_InternInPlace(interp, &string); string = &_Py_ID(loop); assert(_PyUnicode_CheckConsistency(string, 1)); _PyUnicode_InternInPlace(interp, &string); @@ -1455,9 +1431,6 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) { string = &_Py_ID(metaclass); assert(_PyUnicode_CheckConsistency(string, 1)); _PyUnicode_InternInPlace(interp, &string); - string = &_Py_ID(metadata); - assert(_PyUnicode_CheckConsistency(string, 1)); - _PyUnicode_InternInPlace(interp, &string); string = &_Py_ID(method); assert(_PyUnicode_CheckConsistency(string, 1)); _PyUnicode_InternInPlace(interp, &string); @@ -1521,9 +1494,6 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) { string = &_Py_ID(new_file_name); assert(_PyUnicode_CheckConsistency(string, 1)); _PyUnicode_InternInPlace(interp, &string); - string = &_Py_ID(new_limit); - assert(_PyUnicode_CheckConsistency(string, 1)); - _PyUnicode_InternInPlace(interp, &string); string = &_Py_ID(newline); assert(_PyUnicode_CheckConsistency(string, 1)); _PyUnicode_InternInPlace(interp, &string); @@ -1533,9 +1503,6 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) { string = &_Py_ID(next); assert(_PyUnicode_CheckConsistency(string, 1)); _PyUnicode_InternInPlace(interp, &string); - string = &_Py_ID(nlocals); - assert(_PyUnicode_CheckConsistency(string, 1)); - _PyUnicode_InternInPlace(interp, &string); string = &_Py_ID(node_depth); assert(_PyUnicode_CheckConsistency(string, 1)); _PyUnicode_InternInPlace(interp, &string); @@ -1776,9 +1743,6 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) { string = &_Py_ID(reversed); assert(_PyUnicode_CheckConsistency(string, 1)); _PyUnicode_InternInPlace(interp, &string); - string = &_Py_ID(s); - assert(_PyUnicode_CheckConsistency(string, 1)); - _PyUnicode_InternInPlace(interp, &string); string = &_Py_ID(salt); assert(_PyUnicode_CheckConsistency(string, 1)); _PyUnicode_InternInPlace(interp, &string); @@ -2001,9 +1965,6 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) { string = &_Py_ID(truncate); assert(_PyUnicode_CheckConsistency(string, 1)); _PyUnicode_InternInPlace(interp, &string); - string = &_Py_ID(twice); - assert(_PyUnicode_CheckConsistency(string, 1)); - _PyUnicode_InternInPlace(interp, &string); string = &_Py_ID(txt); assert(_PyUnicode_CheckConsistency(string, 1)); _PyUnicode_InternInPlace(interp, &string); diff --git a/Lib/test/clinic.test.c b/Lib/test/clinic.test.c index 2ef7a6e8eb27952..347de8eab263c74 100644 --- a/Lib/test/clinic.test.c +++ b/Lib/test/clinic.test.c @@ -1971,8 +1971,6 @@ static PyObject * test_keywords(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -1985,10 +1983,6 @@ test_keywords(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2014,7 +2008,7 @@ test_keywords(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec static PyObject * test_keywords_impl(PyObject *module, PyObject *a, PyObject *b) -/*[clinic end generated code: output=73d46a9ae3320f96 input=0d3484844749c05b]*/ +/*[clinic end generated code: output=9920599199250b38 input=0d3484844749c05b]*/ /*[clinic input] @@ -2041,8 +2035,6 @@ static PyObject * test_keywords_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -2055,10 +2047,6 @@ test_keywords_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2084,7 +2072,7 @@ test_keywords_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, static PyObject * test_keywords_kwonly_impl(PyObject *module, PyObject *a, PyObject *b) -/*[clinic end generated code: output=c9f02a41f425897d input=384adc78bfa0bff7]*/ +/*[clinic end generated code: output=bbfdd09b66fc6fad input=384adc78bfa0bff7]*/ /*[clinic input] @@ -2112,8 +2100,6 @@ static PyObject * test_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -2126,10 +2112,6 @@ test_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", "c", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2168,7 +2150,7 @@ test_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO static PyObject * test_keywords_opt_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c) -/*[clinic end generated code: output=b35d4e66f7283e46 input=eda7964f784f4607]*/ +/*[clinic end generated code: output=1fee3917fb85e0fc input=eda7964f784f4607]*/ /*[clinic input] @@ -2198,8 +2180,6 @@ static PyObject * test_keywords_opt_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -2212,10 +2192,6 @@ test_keywords_opt_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nar #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", "c", "d", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2265,7 +2241,7 @@ test_keywords_opt_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nar static PyObject * test_keywords_opt_kwonly_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c, PyObject *d) -/*[clinic end generated code: output=ede7e6e65106bf2b input=209387a4815e5082]*/ +/*[clinic end generated code: output=4bd2bb03c37969e5 input=209387a4815e5082]*/ /*[clinic input] @@ -2294,8 +2270,6 @@ static PyObject * test_keywords_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -2308,10 +2282,6 @@ test_keywords_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nar #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", "c", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2350,7 +2320,7 @@ test_keywords_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nar static PyObject * test_keywords_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c) -/*[clinic end generated code: output=36d4df939a4c3eef input=18393cc64fa000f4]*/ +/*[clinic end generated code: output=e25881e543341c18 input=18393cc64fa000f4]*/ /*[clinic input] @@ -2377,8 +2347,6 @@ static PyObject * test_posonly_keywords(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -2391,10 +2359,6 @@ test_posonly_keywords(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2420,7 +2384,7 @@ test_posonly_keywords(PyObject *module, PyObject *const *args, Py_ssize_t nargs, static PyObject * test_posonly_keywords_impl(PyObject *module, PyObject *a, PyObject *b) -/*[clinic end generated code: output=4835f4b6cf386c28 input=1767b0ebdf06060e]*/ +/*[clinic end generated code: output=b087aebd82d2e9b1 input=1767b0ebdf06060e]*/ /*[clinic input] @@ -2448,8 +2412,6 @@ static PyObject * test_posonly_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -2462,10 +2424,6 @@ test_posonly_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "c", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2491,7 +2449,7 @@ test_posonly_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P static PyObject * test_posonly_kwonly_impl(PyObject *module, PyObject *a, PyObject *c) -/*[clinic end generated code: output=2570ea156a8d3cb5 input=9042f2818f664839]*/ +/*[clinic end generated code: output=ff95f03217c4fdef input=9042f2818f664839]*/ /*[clinic input] @@ -2521,8 +2479,6 @@ static PyObject * test_posonly_keywords_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -2535,10 +2491,6 @@ test_posonly_keywords_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", "c", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2567,7 +2519,7 @@ test_posonly_keywords_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t static PyObject * test_posonly_keywords_kwonly_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c) -/*[clinic end generated code: output=aaa0e6b5ce02900d input=29546ebdca492fea]*/ +/*[clinic end generated code: output=2e07df8039c290e8 input=29546ebdca492fea]*/ /*[clinic input] @@ -2597,8 +2549,6 @@ static PyObject * test_posonly_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -2611,10 +2561,6 @@ test_posonly_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t na #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", "c", "d", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2655,7 +2601,7 @@ test_posonly_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t na static PyObject * test_posonly_keywords_opt_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c, PyObject *d) -/*[clinic end generated code: output=1d9f2d8420d0a85f input=cdf5a9625e554e9b]*/ +/*[clinic end generated code: output=dc9ae1631b7c8d5a input=cdf5a9625e554e9b]*/ /*[clinic input] @@ -2684,8 +2630,6 @@ static PyObject * test_posonly_keywords_opt2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -2698,10 +2642,6 @@ test_posonly_keywords_opt2(PyObject *module, PyObject *const *args, Py_ssize_t n #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", "c", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2740,7 +2680,7 @@ test_posonly_keywords_opt2(PyObject *module, PyObject *const *args, Py_ssize_t n static PyObject * test_posonly_keywords_opt2_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c) -/*[clinic end generated code: output=a83caa0505b296cf input=1581299d21d16f14]*/ +/*[clinic end generated code: output=6d5d31b118d75e84 input=1581299d21d16f14]*/ /*[clinic input] @@ -2770,8 +2710,6 @@ static PyObject * test_posonly_opt_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -2784,10 +2722,6 @@ test_posonly_opt_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_ #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "", "c", "d", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2833,7 +2767,7 @@ test_posonly_opt_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_ static PyObject * test_posonly_opt_keywords_opt_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c, PyObject *d) -/*[clinic end generated code: output=0b24fba3dc04d26b input=408798ec3d42949f]*/ +/*[clinic end generated code: output=8a9f47e2232bde5d input=408798ec3d42949f]*/ /*[clinic input] @@ -2864,8 +2798,6 @@ static PyObject * test_posonly_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -2878,10 +2810,6 @@ test_posonly_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t narg #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", "c", "d", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2922,7 +2850,7 @@ test_posonly_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t narg static PyObject * test_posonly_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c, PyObject *d) -/*[clinic end generated code: output=592b217bca2f7bcc input=8d8e5643bbbc2309]*/ +/*[clinic end generated code: output=4fa827fbcd38d67b input=8d8e5643bbbc2309]*/ /*[clinic input] @@ -2952,8 +2880,6 @@ static PyObject * test_posonly_kwonly_opt2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -2966,10 +2892,6 @@ test_posonly_kwonly_opt2(PyObject *module, PyObject *const *args, Py_ssize_t nar #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", "c", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -3008,7 +2930,7 @@ test_posonly_kwonly_opt2(PyObject *module, PyObject *const *args, Py_ssize_t nar static PyObject * test_posonly_kwonly_opt2_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c) -/*[clinic end generated code: output=b8b00420826bc11f input=f7e5eed94f75fff0]*/ +/*[clinic end generated code: output=1ac0b3d53e5a1d0f input=f7e5eed94f75fff0]*/ /*[clinic input] @@ -3039,8 +2961,6 @@ static PyObject * test_posonly_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -3053,10 +2973,6 @@ test_posonly_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "", "c", "d", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -3102,7 +3018,7 @@ test_posonly_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t static PyObject * test_posonly_opt_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c, PyObject *d) -/*[clinic end generated code: output=3b9ee879ebee285a input=1e557dc979d120fd]*/ +/*[clinic end generated code: output=c17a5cb33e0ce4d7 input=1e557dc979d120fd]*/ /*[clinic input] @@ -3135,8 +3051,6 @@ static PyObject * test_posonly_keywords_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -3149,10 +3063,6 @@ test_posonly_keywords_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssi #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", "c", "d", "e", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -3196,7 +3106,7 @@ static PyObject * test_posonly_keywords_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c, PyObject *d, PyObject *e) -/*[clinic end generated code: output=d380f84f81cc0e45 input=c3884a4f956fdc89]*/ +/*[clinic end generated code: output=40e466f3fd428d23 input=c3884a4f956fdc89]*/ /*[clinic input] @@ -3227,8 +3137,6 @@ static PyObject * test_posonly_keywords_kwonly_opt2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -3241,10 +3149,6 @@ test_posonly_keywords_kwonly_opt2(PyObject *module, PyObject *const *args, Py_ss #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", "c", "d", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -3285,7 +3189,7 @@ test_posonly_keywords_kwonly_opt2(PyObject *module, PyObject *const *args, Py_ss static PyObject * test_posonly_keywords_kwonly_opt2_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c, PyObject *d) -/*[clinic end generated code: output=ee629e962cb06992 input=68d01d7c0f6dafb0]*/ +/*[clinic end generated code: output=ea1e3a3851cc80e5 input=68d01d7c0f6dafb0]*/ /*[clinic input] @@ -3319,8 +3223,6 @@ static PyObject * test_posonly_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -3333,10 +3235,6 @@ test_posonly_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", "c", "d", "e", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -3389,7 +3287,7 @@ static PyObject * test_posonly_keywords_opt_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c, PyObject *d, PyObject *e) -/*[clinic end generated code: output=a2721babb42ecfd1 input=d0883d45876f186c]*/ +/*[clinic end generated code: output=405e123e37d9804a input=d0883d45876f186c]*/ /*[clinic input] @@ -3423,8 +3321,6 @@ static PyObject * test_posonly_keywords_opt2_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -3437,10 +3333,6 @@ test_posonly_keywords_opt2_kwonly_opt(PyObject *module, PyObject *const *args, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", "c", "d", "e", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -3498,7 +3390,7 @@ static PyObject * test_posonly_keywords_opt2_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c, PyObject *d, PyObject *e) -/*[clinic end generated code: output=0626203eedb6e7e8 input=c95e2e1ec93035ad]*/ +/*[clinic end generated code: output=e2049989e5b99635 input=c95e2e1ec93035ad]*/ /*[clinic input] @@ -3534,8 +3426,6 @@ static PyObject * test_posonly_opt_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -3548,10 +3438,6 @@ test_posonly_opt_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "", "c", "d", "e", "f", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -3617,7 +3503,7 @@ test_posonly_opt_keywords_opt_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c, PyObject *d, PyObject *e, PyObject *f) -/*[clinic end generated code: output=07d8acc04558a5a0 input=9914857713c5bbf8]*/ +/*[clinic end generated code: output=d0f0dc2189833cc1 input=9914857713c5bbf8]*/ /*[clinic input] test_keyword_only_parameter @@ -3643,8 +3529,6 @@ static PyObject * test_keyword_only_parameter(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -3657,10 +3541,6 @@ test_keyword_only_parameter(PyObject *module, PyObject *const *args, Py_ssize_t #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"co_lnotab", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -3693,7 +3573,7 @@ test_keyword_only_parameter(PyObject *module, PyObject *const *args, Py_ssize_t static PyObject * test_keyword_only_parameter_impl(PyObject *module, PyBytesObject *co_lnotab) -/*[clinic end generated code: output=b12fe2e515a62603 input=303df5046c7e37a3]*/ +/*[clinic end generated code: output=1b42a575e594e083 input=303df5046c7e37a3]*/ /*[clinic input] @@ -4004,8 +3884,6 @@ static PyObject * test_vararg(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -4018,10 +3896,6 @@ test_vararg(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -4048,7 +3922,7 @@ test_vararg(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject static PyObject * test_vararg_impl(PyObject *module, PyObject *a, PyObject *args) -/*[clinic end generated code: output=880365c61ae205d7 input=81d33815ad1bae6e]*/ +/*[clinic end generated code: output=8f766099593c1e1b input=81d33815ad1bae6e]*/ /*[clinic input] test_vararg_with_default @@ -4076,8 +3950,6 @@ static PyObject * test_vararg_with_default(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -4090,10 +3962,6 @@ test_vararg_with_default(PyObject *module, PyObject *const *args, Py_ssize_t nar #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -4131,7 +3999,7 @@ test_vararg_with_default(PyObject *module, PyObject *const *args, Py_ssize_t nar static PyObject * test_vararg_with_default_impl(PyObject *module, PyObject *a, PyObject *args, int b) -/*[clinic end generated code: output=291e9a5a09831128 input=6e110b54acd9b22d]*/ +/*[clinic end generated code: output=803a281d6e78064e input=6e110b54acd9b22d]*/ /*[clinic input] test_vararg_with_only_defaults @@ -4159,8 +4027,6 @@ static PyObject * test_vararg_with_only_defaults(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -4173,10 +4039,6 @@ test_vararg_with_only_defaults(PyObject *module, PyObject *const *args, Py_ssize #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"b", "c", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -4219,7 +4081,7 @@ test_vararg_with_only_defaults(PyObject *module, PyObject *const *args, Py_ssize static PyObject * test_vararg_with_only_defaults_impl(PyObject *module, PyObject *args, int b, PyObject *c) -/*[clinic end generated code: output=dd21b28f0db26a4b input=fa56a709a035666e]*/ +/*[clinic end generated code: output=8c6b5a9387027ed8 input=fa56a709a035666e]*/ /*[clinic input] test_paramname_module @@ -4242,8 +4104,6 @@ static PyObject * test_paramname_module(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -4256,10 +4116,6 @@ test_paramname_module(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"module", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -4283,7 +4139,7 @@ test_paramname_module(PyObject *module, PyObject *const *args, Py_ssize_t nargs, static PyObject * test_paramname_module_impl(PyObject *module, PyObject *mod) -/*[clinic end generated code: output=4a2a849ecbcc8b53 input=afefe259667f13ba]*/ +/*[clinic end generated code: output=08cdb289b0c026c3 input=afefe259667f13ba]*/ /*[clinic input] mangle1 @@ -4319,8 +4175,6 @@ static PyObject * mangle1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 9 static struct { PyGC_Head _this_is_not_used; @@ -4333,10 +4187,6 @@ mangle1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwn #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"args", "kwnames", "return_value", "_keywords", "_parser", "argsbuf", "fastargs", "nargs", "noptargs", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -4379,7 +4229,7 @@ mangle1_impl(PyObject *module, PyObject *args, PyObject *kwnames, PyObject *return_value, PyObject *_keywords, PyObject *_parser, PyObject *argsbuf, PyObject *fastargs, PyObject *nargs, PyObject *noptargs) -/*[clinic end generated code: output=083e5076be9987c3 input=a3ed51bdedf8a3c7]*/ +/*[clinic end generated code: output=f7899a3ecba73eb4 input=a3ed51bdedf8a3c7]*/ /*[clinic input] mangle2 @@ -4406,8 +4256,6 @@ static PyObject * mangle2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -4420,10 +4268,6 @@ mangle2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwn #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"args", "kwargs", "return_value", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -4452,7 +4296,7 @@ mangle2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwn static PyObject * mangle2_impl(PyObject *module, PyObject *args, PyObject *kwargs, PyObject *return_value) -/*[clinic end generated code: output=2ebb62aaefe7590a input=391766fee51bad7a]*/ +/*[clinic end generated code: output=70dbd4130890c91c input=391766fee51bad7a]*/ /*[clinic input] @@ -4477,8 +4321,6 @@ static PyObject * Test_cls_with_param(TestObj *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -4491,10 +4333,6 @@ Test_cls_with_param(TestObj *self, PyTypeObject *cls, PyObject *const *args, Py_ #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -4521,7 +4359,7 @@ Test_cls_with_param(TestObj *self, PyTypeObject *cls, PyObject *const *args, Py_ static PyObject * Test_cls_with_param_impl(TestObj *self, PyTypeObject *cls, int a) -/*[clinic end generated code: output=d89b99e83d442be0 input=af158077bd237ef9]*/ +/*[clinic end generated code: output=bcfef2ddb1f63d3a input=af158077bd237ef9]*/ /*[clinic input] @@ -4825,8 +4663,6 @@ static int Test___init__(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -4839,10 +4675,6 @@ Test___init__(PyObject *self, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -4868,7 +4700,7 @@ Test___init__(PyObject *self, PyObject *args, PyObject *kwargs) static int Test___init___impl(TestObj *self, PyObject *a) -/*[clinic end generated code: output=0b9ca79638ab3ecb input=a8f9222a6ab35c59]*/ +/*[clinic end generated code: output=f0fa89a7994b19b2 input=a8f9222a6ab35c59]*/ /*[clinic input] @@ -5030,8 +4862,6 @@ static PyObject * mangled_c_keyword_identifier(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -5044,10 +4874,6 @@ mangled_c_keyword_identifier(PyObject *module, PyObject *const *args, Py_ssize_t #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"i", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -5074,7 +4900,7 @@ mangled_c_keyword_identifier(PyObject *module, PyObject *const *args, Py_ssize_t static PyObject * mangled_c_keyword_identifier_impl(PyObject *module, int int_value) -/*[clinic end generated code: output=f24b37e0368e0eb8 input=060876448ab567a2]*/ +/*[clinic end generated code: output=42909f0e4f532f55 input=060876448ab567a2]*/ /*[clinic input] @@ -5334,8 +5160,6 @@ static PyObject * fn_with_default_binop_expr(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -5348,10 +5172,6 @@ fn_with_default_binop_expr(PyObject *module, PyObject *const *args, Py_ssize_t n #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"arg", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -5380,7 +5200,7 @@ fn_with_default_binop_expr(PyObject *module, PyObject *const *args, Py_ssize_t n static PyObject * fn_with_default_binop_expr_impl(PyObject *module, PyObject *arg) -/*[clinic end generated code: output=018672772e4092ff input=1b55c8ae68d89453]*/ +/*[clinic end generated code: output=a4ef6a73595de543 input=1b55c8ae68d89453]*/ /*[python input] @@ -5423,8 +5243,6 @@ static PyObject * docstr_fallback_to_converter_default(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -5437,10 +5255,6 @@ docstr_fallback_to_converter_default(PyObject *module, PyObject *const *args, Py #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -5466,4 +5280,4 @@ docstr_fallback_to_converter_default(PyObject *module, PyObject *const *args, Py static PyObject * docstr_fallback_to_converter_default_impl(PyObject *module, str a) -/*[clinic end generated code: output=ae24a9c6f60ee8a6 input=0cbe6a4d24bc2274]*/ +/*[clinic end generated code: output=0c1268c312280921 input=0cbe6a4d24bc2274]*/ diff --git a/Lib/test/test_clinic.py b/Lib/test/test_clinic.py index b29f2ea55516fe7..908ca2a9b134320 100644 --- a/Lib/test/test_clinic.py +++ b/Lib/test/test_clinic.py @@ -23,7 +23,10 @@ def _make_clinic(*, filename='clinic_tests'): clang = clinic.CLanguage(None) - c = clinic.Clinic(clang, filename=filename, limited_capi=False) + c = clinic.Clinic(clang, + filename=filename, + limited_capi=False, + internal_capi=True) c.block_parser = clinic.BlockParser('', clang) return c @@ -125,7 +128,7 @@ def test_parse_with_body_prefix(self): clang.body_prefix = "//" clang.start_line = "//[{dsl_name} start]" clang.stop_line = "//[{dsl_name} stop]" - cl = clinic.Clinic(clang, filename="test.c", limited_capi=False) + cl = clinic.Clinic(clang, filename="test.c", limited_capi=False, internal_capi=True) raw = dedent(""" //[clinic start] //module test @@ -834,7 +837,7 @@ def _test(self, input, output): writer = clinic.BlockPrinter(language) c = _make_clinic() for block in blocks: - writer.print_block(block, limited_capi=c.limited_capi, header_includes=c.includes) + writer.print_block(block, header_includes=c.includes) output = writer.f.getvalue() assert output == input, "output != input!\n\noutput " + repr(output) + "\n\n input " + repr(input) @@ -860,7 +863,10 @@ def test_round_trip_2(self): def _test_clinic(self, input, output): language = clinic.CLanguage(None) - c = clinic.Clinic(language, filename="file", limited_capi=False) + c = clinic.Clinic(language, + filename="file", + limited_capi=False, + internal_capi=True) c.parsers['inert'] = InertParser(c) c.parsers['copy'] = CopyParser(c) computed = c.parse(input) @@ -2464,7 +2470,7 @@ def test_cli_force(self): # Verify by checking the checksum. checksum = ( "/*[clinic end generated code: " - "output=c16447c01510dfb3 input=9543a8d2da235301]*/\n" + "output=8a425674444bee7b input=9543a8d2da235301]*/\n" ) with open(fn, 'r', encoding='utf-8') as f: generated = f.read() @@ -2673,12 +2679,6 @@ def test_file_dest(self): preserve [clinic start generated code]*/ - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - # include "pycore_gc.h" // PyGC_Head - # include "pycore_runtime.h" // _Py_ID() - #endif - - PyDoc_VAR(func__doc__); PyDoc_STRVAR(func__doc__, @@ -2691,7 +2691,7 @@ def test_file_dest(self): static PyObject * func(PyObject *module, PyObject *a) - /*[clinic end generated code: output=56c09670e89a0d9a input=a9049054013a1b77]*/ + /*[clinic end generated code: output=3dde2d13002165b9 input=a9049054013a1b77]*/ """) with os_helper.temp_dir() as tmp_dir: in_fn = os.path.join(tmp_dir, "test.c") diff --git a/Modules/_blake2/clinic/blake2b_impl.c.h b/Modules/_blake2/clinic/blake2b_impl.c.h index 384e7142bcfda76..999613e980b3d4c 100644 --- a/Modules/_blake2/clinic/blake2b_impl.c.h +++ b/Modules/_blake2/clinic/blake2b_impl.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head #include "pycore_long.h" // _PyLong_UnsignedLong_Converter() +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(py_blake2b_new__doc__, "blake2b(data=b\'\', /, *, digest_size=_blake2.blake2b.MAX_DIGEST_SIZE,\n" @@ -29,8 +26,6 @@ static PyObject * py_blake2b_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 12 static struct { PyGC_Head _this_is_not_used; @@ -43,10 +38,6 @@ py_blake2b_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "digest_size", "key", "salt", "person", "fanout", "depth", "leaf_size", "node_offset", "node_depth", "inner_size", "last_node", "usedforsecurity", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -277,4 +268,4 @@ _blake2_blake2b_hexdigest(BLAKE2bObject *self, PyObject *Py_UNUSED(ignored)) { return _blake2_blake2b_hexdigest_impl(self); } -/*[clinic end generated code: output=48128782266b7b8e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4f86ca0e11d3d6dc input=a9049054013a1b77]*/ diff --git a/Modules/_blake2/clinic/blake2s_impl.c.h b/Modules/_blake2/clinic/blake2s_impl.c.h index d7a475277e05439..a610c548ce846ea 100644 --- a/Modules/_blake2/clinic/blake2s_impl.c.h +++ b/Modules/_blake2/clinic/blake2s_impl.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head #include "pycore_long.h" // _PyLong_UnsignedLong_Converter() +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(py_blake2s_new__doc__, "blake2s(data=b\'\', /, *, digest_size=_blake2.blake2s.MAX_DIGEST_SIZE,\n" @@ -29,8 +26,6 @@ static PyObject * py_blake2s_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 12 static struct { PyGC_Head _this_is_not_used; @@ -43,10 +38,6 @@ py_blake2s_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "digest_size", "key", "salt", "person", "fanout", "depth", "leaf_size", "node_offset", "node_depth", "inner_size", "last_node", "usedforsecurity", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -277,4 +268,4 @@ _blake2_blake2s_hexdigest(BLAKE2sObject *self, PyObject *Py_UNUSED(ignored)) { return _blake2_blake2s_hexdigest_impl(self); } -/*[clinic end generated code: output=2188af9910a45497 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=83ba10371f5ab139 input=a9049054013a1b77]*/ diff --git a/Modules/_csv.c b/Modules/_csv.c index 9568334b8069c8b..2a8ee70ef6cb9ac 100644 --- a/Modules/_csv.c +++ b/Modules/_csv.c @@ -10,6 +10,9 @@ module instead. #define MODULE_VERSION "1.0" +// Argument Clinic avoids the internal C API +#define Py_ARGUMENT_CLINIC_AVOID_INTERNAL_CAPI + #include "Python.h" #include // offsetof() diff --git a/Modules/_ctypes/clinic/callproc.c.h b/Modules/_ctypes/clinic/callproc.c.h index 6f036bb66b25aa9..a787693ae67cd82 100644 --- a/Modules/_ctypes/clinic/callproc.c.h +++ b/Modules/_ctypes/clinic/callproc.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(create_pointer_type__doc__, "POINTER($module, type, /)\n" "--\n" @@ -35,4 +29,4 @@ PyDoc_STRVAR(create_pointer_inst__doc__, #define CREATE_POINTER_INST_METHODDEF \ {"pointer", (PyCFunction)create_pointer_inst, METH_O, create_pointer_inst__doc__}, -/*[clinic end generated code: output=ae26452a759ba56d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=51b311ea369e5adf input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/_iomodule.c.h b/Modules/_io/clinic/_iomodule.c.h index 77c203681fca445..f96577742bc9732 100644 --- a/Modules/_io/clinic/_iomodule.c.h +++ b/Modules/_io/clinic/_iomodule.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_io_open__doc__, "open($module, /, file, mode=\'r\', buffering=-1, encoding=None,\n" @@ -139,8 +136,6 @@ static PyObject * _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 8 static struct { PyGC_Head _this_is_not_used; @@ -153,10 +148,6 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"file", "mode", "buffering", "encoding", "errors", "newline", "closefd", "opener", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -362,8 +353,6 @@ static PyObject * _io_open_code(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -376,10 +365,6 @@ _io_open_code(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -404,4 +389,4 @@ _io_open_code(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec exit: return return_value; } -/*[clinic end generated code: output=a4ceb802f3a7243f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=127c5b862e811b38 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/bufferedio.c.h b/Modules/_io/clinic/bufferedio.c.h index 32c4a4e177cbbec..9dac23c9bb5f9d4 100644 --- a/Modules/_io/clinic/bufferedio.c.h +++ b/Modules/_io/clinic/bufferedio.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_io__BufferedIOBase_readinto__doc__, "readinto($self, buffer, /)\n" @@ -793,8 +790,6 @@ static int _io_BufferedReader___init__(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -807,10 +802,6 @@ _io_BufferedReader___init__(PyObject *self, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"raw", "buffer_size", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -870,8 +861,6 @@ static int _io_BufferedWriter___init__(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -884,10 +873,6 @@ _io_BufferedWriter___init__(PyObject *self, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"raw", "buffer_size", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1041,8 +1026,6 @@ static int _io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -1055,10 +1038,6 @@ _io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"raw", "buffer_size", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1099,4 +1078,4 @@ _io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=768c3a3a3deabcb4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f984a53064f5d553 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/bytesio.c.h b/Modules/_io/clinic/bytesio.c.h index b5cdd0802b87489..b4bec6ef1d73b9c 100644 --- a/Modules/_io/clinic/bytesio.c.h +++ b/Modules/_io/clinic/bytesio.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _Py_convert_optional_to_ssize_t() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_io_BytesIO_readable__doc__, "readable($self, /)\n" @@ -494,8 +491,6 @@ static int _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -508,10 +503,6 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"initial_bytes", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -539,4 +530,4 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=6b1219bda0619e2a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ad99af3abfedb43e input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/fileio.c.h b/Modules/_io/clinic/fileio.c.h index 7b63e36b5038db1..a007ada7fa18972 100644 --- a/Modules/_io/clinic/fileio.c.h +++ b/Modules/_io/clinic/fileio.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _Py_convert_optional_to_ssize_t() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_io_FileIO_close__doc__, "close($self, /)\n" @@ -60,8 +57,6 @@ static int _io_FileIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -74,10 +69,6 @@ _io_FileIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"file", "mode", "closefd", "opener", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -537,4 +528,4 @@ _io_FileIO_isatty(fileio *self, PyObject *Py_UNUSED(ignored)) #ifndef _IO_FILEIO_TRUNCATE_METHODDEF #define _IO_FILEIO_TRUNCATE_METHODDEF #endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */ -/*[clinic end generated code: output=3a3c6ed7e5e78063 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=07558d24e03a3a22 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/iobase.c.h b/Modules/_io/clinic/iobase.c.h index fb96ea132f3dc56..b2aebf9ae0713ed 100644 --- a/Modules/_io/clinic/iobase.c.h +++ b/Modules/_io/clinic/iobase.c.h @@ -2,11 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _Py_convert_optional_to_ssize_t() PyDoc_STRVAR(_io__IOBase_seek__doc__, @@ -442,4 +437,4 @@ _io__RawIOBase_readall(PyObject *self, PyObject *Py_UNUSED(ignored)) { return _io__RawIOBase_readall_impl(self); } -/*[clinic end generated code: output=d96f5bfd72e6eafb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=df48630514c002e1 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/stringio.c.h b/Modules/_io/clinic/stringio.c.h index dbe1833a90ed8cd..a5a5a86d3165276 100644 --- a/Modules/_io/clinic/stringio.c.h +++ b/Modules/_io/clinic/stringio.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _Py_convert_optional_to_ssize_t() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_io_StringIO_getvalue__doc__, "getvalue($self, /)\n" @@ -262,8 +259,6 @@ static int _io_StringIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -276,10 +271,6 @@ _io_StringIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"initial_value", "newline", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -368,4 +359,4 @@ _io_StringIO_seekable(stringio *self, PyObject *Py_UNUSED(ignored)) { return _io_StringIO_seekable_impl(self); } -/*[clinic end generated code: output=09d4056cc8c4aae4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=15e8e0ba0d4b4f33 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/textio.c.h b/Modules/_io/clinic/textio.c.h index ce6efbe20b6bba3..3bf85cbc889c95c 100644 --- a/Modules/_io/clinic/textio.c.h +++ b/Modules/_io/clinic/textio.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _Py_convert_optional_to_ssize_t() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_io__TextIOBase_detach__doc__, "detach($self, /)\n" @@ -222,8 +219,6 @@ static int _io_IncrementalNewlineDecoder___init__(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -236,10 +231,6 @@ _io_IncrementalNewlineDecoder___init__(PyObject *self, PyObject *args, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"decoder", "translate", "errors", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -291,8 +282,6 @@ static PyObject * _io_IncrementalNewlineDecoder_decode(nldecoder_object *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -305,10 +294,6 @@ _io_IncrementalNewlineDecoder_decode(nldecoder_object *self, PyObject *const *ar #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"input", "final", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -426,8 +411,6 @@ static int _io_TextIOWrapper___init__(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 6 static struct { PyGC_Head _this_is_not_used; @@ -440,10 +423,6 @@ _io_TextIOWrapper___init__(PyObject *self, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"buffer", "encoding", "errors", "newline", "line_buffering", "write_through", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -564,8 +543,6 @@ static PyObject * _io_TextIOWrapper_reconfigure(textio *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -578,10 +555,6 @@ _io_TextIOWrapper_reconfigure(textio *self, PyObject *const *args, Py_ssize_t na #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"encoding", "errors", "newline", "line_buffering", "write_through", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -980,4 +953,4 @@ _io_TextIOWrapper_close(textio *self, PyObject *Py_UNUSED(ignored)) { return _io_TextIOWrapper_close_impl(self); } -/*[clinic end generated code: output=390af0e65a0d02c0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b796bfbc10c0546b input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/winconsoleio.c.h b/Modules/_io/clinic/winconsoleio.c.h index 53f971e37c12581..5ede59bd19eb169 100644 --- a/Modules/_io/clinic/winconsoleio.c.h +++ b/Modules/_io/clinic/winconsoleio.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _Py_convert_optional_to_ssize_t() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() #if defined(HAVE_WINDOWS_CONSOLE_IO) @@ -59,8 +56,6 @@ static int _io__WindowsConsoleIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -73,10 +68,6 @@ _io__WindowsConsoleIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"file", "mode", "closefd", "opener", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -466,4 +457,4 @@ _io__WindowsConsoleIO_isatty(winconsoleio *self, PyObject *Py_UNUSED(ignored)) #ifndef _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF #define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF #endif /* !defined(_IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF) */ -/*[clinic end generated code: output=0cdb16d95f1c7dac input=a9049054013a1b77]*/ +/*[clinic end generated code: output=05eaeb3247ac1ad5 input=a9049054013a1b77]*/ diff --git a/Modules/_multiprocessing/clinic/multiprocessing.c.h b/Modules/_multiprocessing/clinic/multiprocessing.c.h index e8eed0c0c4283f6..0ae0039a666061b 100644 --- a/Modules/_multiprocessing/clinic/multiprocessing.c.h +++ b/Modules/_multiprocessing/clinic/multiprocessing.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - #if defined(MS_WINDOWS) PyDoc_STRVAR(_multiprocessing_closesocket__doc__, @@ -172,4 +166,4 @@ _multiprocessing_sem_unlink(PyObject *module, PyObject *arg) #ifndef _MULTIPROCESSING_SEND_METHODDEF #define _MULTIPROCESSING_SEND_METHODDEF #endif /* !defined(_MULTIPROCESSING_SEND_METHODDEF) */ -/*[clinic end generated code: output=eb078dff6b6595ff input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8b91c020d4353cc5 input=a9049054013a1b77]*/ diff --git a/Modules/_multiprocessing/clinic/posixshmem.c.h b/Modules/_multiprocessing/clinic/posixshmem.c.h index 265f46889d531bf..1aac7798635a8b5 100644 --- a/Modules/_multiprocessing/clinic/posixshmem.c.h +++ b/Modules/_multiprocessing/clinic/posixshmem.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - #if defined(HAVE_SHM_OPEN) PyDoc_STRVAR(_posixshmem_shm_open__doc__, @@ -27,23 +21,7 @@ static PyObject * _posixshmem_shm_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - - #define NUM_KEYWORDS 3 - static struct { - PyGC_Head _this_is_not_used; - PyObject_VAR_HEAD - PyObject *ob_item[NUM_KEYWORDS]; - } _kwtuple = { - .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) - .ob_item = { &_Py_ID(path), &_Py_ID(flags), &_Py_ID(mode), }, - }; - #undef NUM_KEYWORDS - #define KWTUPLE (&_kwtuple.ob_base.ob_base) - - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE + #define KWTUPLE NULL static const char * const _keywords[] = {"path", "flags", "mode", NULL}; static _PyArg_Parser _parser = { @@ -114,23 +92,7 @@ static PyObject * _posixshmem_shm_unlink(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - - #define NUM_KEYWORDS 1 - static struct { - PyGC_Head _this_is_not_used; - PyObject_VAR_HEAD - PyObject *ob_item[NUM_KEYWORDS]; - } _kwtuple = { - .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) - .ob_item = { &_Py_ID(path), }, - }; - #undef NUM_KEYWORDS - #define KWTUPLE (&_kwtuple.ob_base.ob_base) - - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE + #define KWTUPLE NULL static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = { @@ -166,4 +128,4 @@ _posixshmem_shm_unlink(PyObject *module, PyObject *const *args, Py_ssize_t nargs #ifndef _POSIXSHMEM_SHM_UNLINK_METHODDEF #define _POSIXSHMEM_SHM_UNLINK_METHODDEF #endif /* !defined(_POSIXSHMEM_SHM_UNLINK_METHODDEF) */ -/*[clinic end generated code: output=c022e2f7371fdece input=a9049054013a1b77]*/ +/*[clinic end generated code: output=77ad51f393a9e935 input=a9049054013a1b77]*/ diff --git a/Modules/_multiprocessing/clinic/semaphore.c.h b/Modules/_multiprocessing/clinic/semaphore.c.h index c5bffc843570d8a..2f87c65a2057cc2 100644 --- a/Modules/_multiprocessing/clinic/semaphore.c.h +++ b/Modules/_multiprocessing/clinic/semaphore.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() #if defined(HAVE_MP_SEMAPHORE) && defined(MS_WINDOWS) @@ -27,8 +24,6 @@ static PyObject * _multiprocessing_SemLock_acquire(SemLockObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -41,10 +36,6 @@ _multiprocessing_SemLock_acquire(SemLockObject *self, PyObject *const *args, Py_ #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"block", "timeout", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -124,8 +115,6 @@ static PyObject * _multiprocessing_SemLock_acquire(SemLockObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -138,10 +127,6 @@ _multiprocessing_SemLock_acquire(SemLockObject *self, PyObject *const *args, Py_ #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"block", "timeout", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -212,8 +197,6 @@ static PyObject * _multiprocessing_SemLock(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -226,10 +209,6 @@ _multiprocessing_SemLock(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"kind", "value", "maxvalue", "name", "unlink", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -542,4 +521,4 @@ _multiprocessing_SemLock___exit__(SemLockObject *self, PyObject *const *args, Py #ifndef _MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF #define _MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF #endif /* !defined(_MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF) */ -/*[clinic end generated code: output=0fcadfdd8d6944be input=a9049054013a1b77]*/ +/*[clinic end generated code: output=198f4dcf1043ae1a input=a9049054013a1b77]*/ diff --git a/Modules/_multiprocessing/posixshmem.c b/Modules/_multiprocessing/posixshmem.c index debef3267f77d1f..4cdaadb0b305d79 100644 --- a/Modules/_multiprocessing/posixshmem.c +++ b/Modules/_multiprocessing/posixshmem.c @@ -2,6 +2,9 @@ posixshmem - A Python extension that provides shm_open() and shm_unlink() */ +// Argument Clinic avoids the internal C API +#define Py_ARGUMENT_CLINIC_AVOID_INTERNAL_CAPI + #include // for shm_open() and shm_unlink() diff --git a/Modules/_sqlite/clinic/_sqlite3.connect.c.h b/Modules/_sqlite/clinic/_sqlite3.connect.c.h index 998c8de1e09f164..de7cf92a218cf90 100644 --- a/Modules/_sqlite/clinic/_sqlite3.connect.c.h +++ b/Modules/_sqlite/clinic/_sqlite3.connect.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(pysqlite_connect__doc__, "connect($module, /, database, timeout=5.0, detect_types=0,\n" @@ -28,4 +25,4 @@ PyDoc_STRVAR(pysqlite_connect__doc__, #define PYSQLITE_CONNECT_METHODDEF \ {"connect", _PyCFunction_CAST(pysqlite_connect), METH_FASTCALL|METH_KEYWORDS, pysqlite_connect__doc__}, -/*[clinic end generated code: output=8d49736db880f09a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9980c76ede56e13f input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/blob.c.h b/Modules/_sqlite/clinic/blob.c.h index 7dda4d77c72ab17..e7c60264722f7b7 100644 --- a/Modules/_sqlite/clinic/blob.c.h +++ b/Modules/_sqlite/clinic/blob.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(blob_close__doc__, "close($self, /)\n" "--\n" @@ -219,4 +213,4 @@ blob_exit(pysqlite_Blob *self, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=1783b816ccc3bb75 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8bfd79ab12ac5385 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/connection.c.h b/Modules/_sqlite/clinic/connection.c.h index f9510f47dd9efa1..e9be39ca1d131f5 100644 --- a/Modules/_sqlite/clinic/connection.c.h +++ b/Modules/_sqlite/clinic/connection.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() static int pysqlite_connection_init_impl(pysqlite_Connection *self, PyObject *database, @@ -31,8 +28,6 @@ static int pysqlite_connection_init(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 9 static struct { PyGC_Head _this_is_not_used; @@ -45,10 +40,6 @@ pysqlite_connection_init(PyObject *self, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"database", "timeout", "detect_types", "isolation_level", "check_same_thread", "factory", "cached_statements", "uri", "autocommit", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -184,8 +175,6 @@ static PyObject * pysqlite_connection_cursor(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -198,10 +187,6 @@ pysqlite_connection_cursor(pysqlite_Connection *self, PyObject *const *args, Py_ #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"factory", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -256,8 +241,6 @@ static PyObject * blobopen(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -270,10 +253,6 @@ blobopen(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs, PyO #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "", "", "readonly", "name", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -449,8 +428,6 @@ static PyObject * pysqlite_connection_create_function(pysqlite_Connection *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -463,10 +440,6 @@ pysqlite_connection_create_function(pysqlite_Connection *self, PyTypeObject *cls #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"name", "narg", "func", "deterministic", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -640,8 +613,6 @@ static PyObject * pysqlite_connection_create_aggregate(pysqlite_Connection *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -654,10 +625,6 @@ pysqlite_connection_create_aggregate(pysqlite_Connection *self, PyTypeObject *cl #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"name", "n_arg", "aggregate_class", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -742,8 +709,6 @@ static PyObject * pysqlite_connection_set_authorizer(pysqlite_Connection *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -756,10 +721,6 @@ pysqlite_connection_set_authorizer(pysqlite_Connection *self, PyTypeObject *cls, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"authorizer_callback", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -835,8 +796,6 @@ static PyObject * pysqlite_connection_set_progress_handler(pysqlite_Connection *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -849,10 +808,6 @@ pysqlite_connection_set_progress_handler(pysqlite_Connection *self, PyTypeObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"progress_handler", "n", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -923,8 +878,6 @@ static PyObject * pysqlite_connection_set_trace_callback(pysqlite_Connection *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -937,10 +890,6 @@ pysqlite_connection_set_trace_callback(pysqlite_Connection *self, PyTypeObject * #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"trace_callback", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1025,8 +974,6 @@ static PyObject * pysqlite_connection_load_extension(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1039,10 +986,6 @@ pysqlite_connection_load_extension(pysqlite_Connection *self, PyObject *const *a #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "entrypoint", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1241,8 +1184,6 @@ static PyObject * pysqlite_connection_backup(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -1255,10 +1196,6 @@ pysqlite_connection_backup(pysqlite_Connection *self, PyObject *const *args, Py_ #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"target", "pages", "progress", "name", "sleep", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1422,8 +1359,6 @@ static PyObject * serialize(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1436,10 +1371,6 @@ serialize(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs, Py #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"name", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1511,8 +1442,6 @@ static PyObject * deserialize(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1525,10 +1454,6 @@ deserialize(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "name", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1822,4 +1747,4 @@ getconfig(pysqlite_Connection *self, PyObject *arg) #ifndef DESERIALIZE_METHODDEF #define DESERIALIZE_METHODDEF #endif /* !defined(DESERIALIZE_METHODDEF) */ -/*[clinic end generated code: output=f06b254bc5c2bcaf input=a9049054013a1b77]*/ +/*[clinic end generated code: output=db43c2cbf29ac056 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/cursor.c.h b/Modules/_sqlite/clinic/cursor.c.h index 1a21a1c41dafd85..d357a794f4cb547 100644 --- a/Modules/_sqlite/clinic/cursor.c.h +++ b/Modules/_sqlite/clinic/cursor.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() static int pysqlite_cursor_init_impl(pysqlite_Cursor *self, @@ -187,8 +184,6 @@ static PyObject * pysqlite_cursor_fetchmany(pysqlite_Cursor *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -201,10 +196,6 @@ pysqlite_cursor_fetchmany(pysqlite_Cursor *self, PyObject *const *args, Py_ssize #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"size", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -313,4 +304,4 @@ pysqlite_cursor_close(pysqlite_Cursor *self, PyObject *Py_UNUSED(ignored)) { return pysqlite_cursor_close_impl(self); } -/*[clinic end generated code: output=b56b3ddb3b6df8c6 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=59d7f67e986db210 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/module.c.h b/Modules/_sqlite/clinic/module.c.h index 82e628ababd4a17..811a8abbef21f91 100644 --- a/Modules/_sqlite/clinic/module.c.h +++ b/Modules/_sqlite/clinic/module.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(pysqlite_complete_statement__doc__, "complete_statement($module, /, statement)\n" @@ -24,8 +21,6 @@ static PyObject * pysqlite_complete_statement(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -38,10 +33,6 @@ pysqlite_complete_statement(PyObject *module, PyObject *const *args, Py_ssize_t #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"statement", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -208,4 +199,4 @@ pysqlite_adapt(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=c1d450089867b4bf input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0e5c59ca4e3c47cd input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/row.c.h b/Modules/_sqlite/clinic/row.c.h index 89a48fd52da2268..cdf850d01e01a32 100644 --- a/Modules/_sqlite/clinic/row.c.h +++ b/Modules/_sqlite/clinic/row.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - static PyObject * pysqlite_row_new_impl(PyTypeObject *type, pysqlite_Cursor *cursor, PyObject *data); @@ -60,4 +54,4 @@ pysqlite_row_keys(pysqlite_Row *self, PyObject *Py_UNUSED(ignored)) { return pysqlite_row_keys_impl(self); } -/*[clinic end generated code: output=157b31ac3f6af1ba input=a9049054013a1b77]*/ +/*[clinic end generated code: output=972487d535d2e7d5 input=a9049054013a1b77]*/ diff --git a/Modules/_sre/clinic/sre.c.h b/Modules/_sre/clinic/sre.c.h index 1846f175b4585a9..04ae3e9f18fed26 100644 --- a/Modules/_sre/clinic/sre.c.h +++ b/Modules/_sre/clinic/sre.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_sre_getcodesize__doc__, "getcodesize($module, /)\n" @@ -182,8 +179,6 @@ static PyObject * _sre_SRE_Pattern_match(PatternObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -196,10 +191,6 @@ _sre_SRE_Pattern_match(PatternObject *self, PyTypeObject *cls, PyObject *const * #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "pos", "endpos", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -275,8 +266,6 @@ static PyObject * _sre_SRE_Pattern_fullmatch(PatternObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -289,10 +278,6 @@ _sre_SRE_Pattern_fullmatch(PatternObject *self, PyTypeObject *cls, PyObject *con #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "pos", "endpos", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -370,8 +355,6 @@ static PyObject * _sre_SRE_Pattern_search(PatternObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -384,10 +367,6 @@ _sre_SRE_Pattern_search(PatternObject *self, PyTypeObject *cls, PyObject *const #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "pos", "endpos", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -462,8 +441,6 @@ static PyObject * _sre_SRE_Pattern_findall(PatternObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -476,10 +453,6 @@ _sre_SRE_Pattern_findall(PatternObject *self, PyObject *const *args, Py_ssize_t #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "pos", "endpos", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -557,8 +530,6 @@ static PyObject * _sre_SRE_Pattern_finditer(PatternObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -571,10 +542,6 @@ _sre_SRE_Pattern_finditer(PatternObject *self, PyTypeObject *cls, PyObject *cons #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "pos", "endpos", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -649,8 +616,6 @@ static PyObject * _sre_SRE_Pattern_scanner(PatternObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -663,10 +628,6 @@ _sre_SRE_Pattern_scanner(PatternObject *self, PyTypeObject *cls, PyObject *const #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "pos", "endpos", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -741,8 +702,6 @@ static PyObject * _sre_SRE_Pattern_split(PatternObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -755,10 +714,6 @@ _sre_SRE_Pattern_split(PatternObject *self, PyObject *const *args, Py_ssize_t na #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "maxsplit", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -815,8 +770,6 @@ static PyObject * _sre_SRE_Pattern_sub(PatternObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -829,10 +782,6 @@ _sre_SRE_Pattern_sub(PatternObject *self, PyTypeObject *cls, PyObject *const *ar #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"repl", "string", "count", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -892,8 +841,6 @@ static PyObject * _sre_SRE_Pattern_subn(PatternObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -906,10 +853,6 @@ _sre_SRE_Pattern_subn(PatternObject *self, PyTypeObject *cls, PyObject *const *a #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"repl", "string", "count", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -994,8 +937,6 @@ static PyObject * _sre_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 6 static struct { PyGC_Head _this_is_not_used; @@ -1008,10 +949,6 @@ _sre_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"pattern", "flags", "code", "groups", "groupindex", "indexgroup", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1124,8 +1061,6 @@ static PyObject * _sre_SRE_Match_expand(MatchObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1138,10 +1073,6 @@ _sre_SRE_Match_expand(MatchObject *self, PyObject *const *args, Py_ssize_t nargs #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"template", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1182,8 +1113,6 @@ static PyObject * _sre_SRE_Match_groups(MatchObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1196,10 +1125,6 @@ _sre_SRE_Match_groups(MatchObject *self, PyObject *const *args, Py_ssize_t nargs #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"default", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1245,8 +1170,6 @@ static PyObject * _sre_SRE_Match_groupdict(MatchObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1259,10 +1182,6 @@ _sre_SRE_Match_groupdict(MatchObject *self, PyObject *const *args, Py_ssize_t na #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"default", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1461,4 +1380,4 @@ _sre_SRE_Scanner_search(ScannerObject *self, PyTypeObject *cls, PyObject *const } return _sre_SRE_Scanner_search_impl(self, cls); } -/*[clinic end generated code: output=b8cf77f05e44d08c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8c7ca3f633c92695 input=a9049054013a1b77]*/ diff --git a/Modules/_ssl/clinic/cert.c.h b/Modules/_ssl/clinic/cert.c.h index e2842263bec04db..469566d11811b36 100644 --- a/Modules/_ssl/clinic/cert.c.h +++ b/Modules/_ssl/clinic/cert.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_ssl_Certificate_public_bytes__doc__, "public_bytes($self, /, format=Encoding.PEM)\n" @@ -23,8 +20,6 @@ static PyObject * _ssl_Certificate_public_bytes(PySSLCertificate *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -37,10 +32,6 @@ _ssl_Certificate_public_bytes(PySSLCertificate *self, PyObject *const *args, Py_ #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"format", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -86,4 +77,4 @@ _ssl_Certificate_get_info(PySSLCertificate *self, PyObject *Py_UNUSED(ignored)) { return _ssl_Certificate_get_info_impl(self); } -/*[clinic end generated code: output=72e2bb139c64546c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d0ace3ce6a6f3e58 input=a9049054013a1b77]*/ diff --git a/Modules/_testcapi/clinic/exceptions.c.h b/Modules/_testcapi/clinic/exceptions.c.h index 61a9103b97f5b4f..e6d26f6e2413d75 100644 --- a/Modules/_testcapi/clinic/exceptions.c.h +++ b/Modules/_testcapi/clinic/exceptions.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_testcapi_err_set_raised__doc__, "err_set_raised($module, exception, /)\n" "--\n" @@ -72,23 +66,7 @@ static PyObject * _testcapi_make_exception_with_doc(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - - #define NUM_KEYWORDS 4 - static struct { - PyGC_Head _this_is_not_used; - PyObject_VAR_HEAD - PyObject *ob_item[NUM_KEYWORDS]; - } _kwtuple = { - .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) - .ob_item = { &_Py_ID(name), &_Py_ID(doc), &_Py_ID(base), &_Py_ID(dict), }, - }; - #undef NUM_KEYWORDS - #define KWTUPLE (&_kwtuple.ob_base.ob_base) - - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE + #define KWTUPLE NULL static const char * const _keywords[] = {"name", "doc", "base", "dict", NULL}; static _PyArg_Parser _parser = { @@ -488,4 +466,4 @@ _testcapi_unstable_exc_prep_reraise_star(PyObject *module, PyObject *const *args exit: return return_value; } -/*[clinic end generated code: output=6c4b7ad1cb1e0153 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d753528f90888a69 input=a9049054013a1b77]*/ diff --git a/Modules/_testcapi/clinic/float.c.h b/Modules/_testcapi/clinic/float.c.h index 84de17a8ee17626..fb0931a0703e11b 100644 --- a/Modules/_testcapi/clinic/float.c.h +++ b/Modules/_testcapi/clinic/float.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_testcapi_float_pack__doc__, "float_pack($module, size, d, le, /)\n" "--\n" @@ -85,4 +79,4 @@ _testcapi_float_unpack(PyObject *module, PyObject *const *args, Py_ssize_t nargs exit: return return_value; } -/*[clinic end generated code: output=de6879d0f4987d79 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=50146051f1341cce input=a9049054013a1b77]*/ diff --git a/Modules/_testcapi/clinic/long.c.h b/Modules/_testcapi/clinic/long.c.h index 87bba4cfacfe557..b77cb51810cb65a 100644 --- a/Modules/_testcapi/clinic/long.c.h +++ b/Modules/_testcapi/clinic/long.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_testcapi_test_long_api__doc__, "test_long_api($module, /)\n" "--\n" @@ -171,4 +165,4 @@ PyDoc_STRVAR(_testcapi_PyLong_AsInt__doc__, #define _TESTCAPI_PYLONG_ASINT_METHODDEF \ {"PyLong_AsInt", (PyCFunction)_testcapi_PyLong_AsInt, METH_O, _testcapi_PyLong_AsInt__doc__}, -/*[clinic end generated code: output=1631a18f1193486a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=31267ab2dd90aa1d input=a9049054013a1b77]*/ diff --git a/Modules/_testcapi/clinic/vectorcall.c.h b/Modules/_testcapi/clinic/vectorcall.c.h index 728c0d382565a7f..48688e9ade050a8 100644 --- a/Modules/_testcapi/clinic/vectorcall.c.h +++ b/Modules/_testcapi/clinic/vectorcall.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_testcapi_pyobject_fastcalldict__doc__, "pyobject_fastcalldict($module, func, func_args, kwargs, /)\n" "--\n" @@ -210,4 +204,4 @@ _testcapi_has_vectorcall_flag(PyObject *module, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=beaf6beac3d13c25 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0667266b825ec9ec input=a9049054013a1b77]*/ diff --git a/Modules/_testcapi/clinic/watchers.c.h b/Modules/_testcapi/clinic/watchers.c.h index ce9c770a37cc5f6..fd2ef6083340495 100644 --- a/Modules/_testcapi/clinic/watchers.c.h +++ b/Modules/_testcapi/clinic/watchers.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_testcapi_watch_dict__doc__, "watch_dict($module, watcher_id, dict, /)\n" "--\n" @@ -195,4 +189,4 @@ _testcapi_set_func_kwdefaults_via_capi(PyObject *module, PyObject *const *args, exit: return return_value; } -/*[clinic end generated code: output=b7564a84c5815b46 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5ad5771d6b29dfb9 input=a9049054013a1b77]*/ diff --git a/Modules/_testcapi/exceptions.c b/Modules/_testcapi/exceptions.c index d7edf8c7ce6744a..add2aae48d285e7 100644 --- a/Modules/_testcapi/exceptions.c +++ b/Modules/_testcapi/exceptions.c @@ -1,3 +1,6 @@ +// Argument Clinic avoids the internal C API +#define Py_ARGUMENT_CLINIC_AVOID_INTERNAL_CAPI + #include "parts.h" #include "clinic/exceptions.c.h" diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c index e375ca8556d2172..e9b1edfffb06472 100644 --- a/Modules/_testinternalcapi.c +++ b/Modules/_testinternalcapi.c @@ -6,9 +6,13 @@ # define Py_BUILD_CORE_MODULE 1 #endif -/* Always enable assertions */ +// Always enable assertions #undef NDEBUG +// Argument Clinic avoids the internal C API, since _testinternalcapi is built +// as a shared extension which cannot use the _Py_ID() API on Windows. +#define Py_ARGUMENT_CLINIC_AVOID_INTERNAL_CAPI + #include "Python.h" #include "pycore_atomic_funcs.h" // _Py_atomic_int_get() #include "pycore_bitutils.h" // _Py_bswap32() diff --git a/Modules/_testmultiphase.c b/Modules/_testmultiphase.c index fdef06168bfc86b..ed094956831ea75 100644 --- a/Modules/_testmultiphase.c +++ b/Modules/_testmultiphase.c @@ -5,6 +5,10 @@ # define Py_BUILD_CORE_MODULE 1 #endif +// Argument Clinic avoids the internal C API, since _testmultiphase is built as +// a shared extension which cannot use the _Py_ID() API on Windows. +#define Py_ARGUMENT_CLINIC_AVOID_INTERNAL_CAPI + #include "Python.h" #include "pycore_namespace.h" // _PyNamespace_New() diff --git a/Modules/cjkcodecs/clinic/multibytecodec.c.h b/Modules/cjkcodecs/clinic/multibytecodec.c.h index 1b41c231eac5d87..d5a960c4861dad4 100644 --- a/Modules/cjkcodecs/clinic/multibytecodec.c.h +++ b/Modules/cjkcodecs/clinic/multibytecodec.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_multibytecodec_MultibyteCodec_encode__doc__, "encode($self, /, input, errors=None)\n" @@ -31,8 +28,6 @@ static PyObject * _multibytecodec_MultibyteCodec_encode(MultibyteCodecObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -45,10 +40,6 @@ _multibytecodec_MultibyteCodec_encode(MultibyteCodecObject *self, PyObject *cons #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"input", "errors", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -117,8 +108,6 @@ static PyObject * _multibytecodec_MultibyteCodec_decode(MultibyteCodecObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -131,10 +120,6 @@ _multibytecodec_MultibyteCodec_decode(MultibyteCodecObject *self, PyObject *cons #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"input", "errors", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -208,8 +193,6 @@ static PyObject * _multibytecodec_MultibyteIncrementalEncoder_encode(MultibyteIncrementalEncoderObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -222,10 +205,6 @@ _multibytecodec_MultibyteIncrementalEncoder_encode(MultibyteIncrementalEncoderOb #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"input", "final", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -337,8 +316,6 @@ static PyObject * _multibytecodec_MultibyteIncrementalDecoder_decode(MultibyteIncrementalDecoderObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -351,10 +328,6 @@ _multibytecodec_MultibyteIncrementalDecoder_decode(MultibyteIncrementalDecoderOb #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"input", "final", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -690,4 +663,4 @@ PyDoc_STRVAR(_multibytecodec___create_codec__doc__, #define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \ {"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__}, -/*[clinic end generated code: output=5f0e8dacddb0ac76 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=51c59d46f83f7e1e input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_abc.c.h b/Modules/clinic/_abc.c.h index 2adec818c913114..8d3832e1b83d2d3 100644 --- a/Modules/clinic/_abc.c.h +++ b/Modules/clinic/_abc.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_abc__reset_registry__doc__, "_reset_registry($module, self, /)\n" "--\n" @@ -165,4 +159,4 @@ _abc_get_cache_token(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _abc_get_cache_token_impl(module); } -/*[clinic end generated code: output=c2e69611a495c98d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=babb3ce445fa9b21 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_asynciomodule.c.h b/Modules/clinic/_asynciomodule.c.h index 6a780a80cd0bc47..c3b7e405455edb3 100644 --- a/Modules/clinic/_asynciomodule.c.h +++ b/Modules/clinic/_asynciomodule.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_asyncio_Future___init____doc__, "Future(*, loop=None)\n" @@ -32,8 +29,6 @@ static int _asyncio_Future___init__(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -46,10 +41,6 @@ _asyncio_Future___init__(PyObject *self, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"loop", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -242,8 +233,6 @@ static PyObject * _asyncio_Future_add_done_callback(FutureObj *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -256,10 +245,6 @@ _asyncio_Future_add_done_callback(FutureObj *self, PyTypeObject *cls, PyObject * #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "context", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -355,8 +340,6 @@ static PyObject * _asyncio_Future_cancel(FutureObj *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -369,10 +352,6 @@ _asyncio_Future_cancel(FutureObj *self, PyTypeObject *cls, PyObject *const *args #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"msg", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -496,8 +475,6 @@ static int _asyncio_Task___init__(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -510,10 +487,6 @@ _asyncio_Task___init__(PyObject *self, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"coro", "loop", "name", "context", "eager_start", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -624,8 +597,6 @@ static PyObject * _asyncio_Task_cancel(TaskObj *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -638,10 +609,6 @@ _asyncio_Task_cancel(TaskObj *self, PyObject *const *args, Py_ssize_t nargs, PyO #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"msg", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -747,8 +714,6 @@ static PyObject * _asyncio_Task_get_stack(TaskObj *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -761,10 +726,6 @@ _asyncio_Task_get_stack(TaskObj *self, PyTypeObject *cls, PyObject *const *args, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"limit", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -814,8 +775,6 @@ static PyObject * _asyncio_Task_print_stack(TaskObj *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -828,10 +787,6 @@ _asyncio_Task_print_stack(TaskObj *self, PyTypeObject *cls, PyObject *const *arg #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"limit", "file", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1036,8 +991,6 @@ static PyObject * _asyncio__register_task(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1050,10 +1003,6 @@ _asyncio__register_task(PyObject *module, PyObject *const *args, Py_ssize_t narg #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"task", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1093,8 +1042,6 @@ static PyObject * _asyncio__register_eager_task(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1107,10 +1054,6 @@ _asyncio__register_eager_task(PyObject *module, PyObject *const *args, Py_ssize_ #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"task", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1150,8 +1093,6 @@ static PyObject * _asyncio__unregister_task(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1164,10 +1105,6 @@ _asyncio__unregister_task(PyObject *module, PyObject *const *args, Py_ssize_t na #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"task", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1207,8 +1144,6 @@ static PyObject * _asyncio__unregister_eager_task(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1221,10 +1156,6 @@ _asyncio__unregister_eager_task(PyObject *module, PyObject *const *args, Py_ssiz #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"task", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1266,8 +1197,6 @@ static PyObject * _asyncio__enter_task(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -1280,10 +1209,6 @@ _asyncio__enter_task(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"loop", "task", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1327,8 +1252,6 @@ static PyObject * _asyncio__leave_task(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -1341,10 +1264,6 @@ _asyncio__leave_task(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"loop", "task", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1387,8 +1306,6 @@ static PyObject * _asyncio__swap_current_task(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -1401,10 +1318,6 @@ _asyncio__swap_current_task(PyObject *module, PyObject *const *args, Py_ssize_t #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"loop", "task", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1444,8 +1357,6 @@ static PyObject * _asyncio_current_task(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1458,10 +1369,6 @@ _asyncio_current_task(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"loop", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1487,4 +1394,4 @@ _asyncio_current_task(PyObject *module, PyObject *const *args, Py_ssize_t nargs, exit: return return_value; } -/*[clinic end generated code: output=6b0e283177b07639 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=6a422b01a168692d input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_bisectmodule.c.h b/Modules/clinic/_bisectmodule.c.h index 62ce0fc81723672..bce8e8dc5475aa6 100644 --- a/Modules/clinic/_bisectmodule.c.h +++ b/Modules/clinic/_bisectmodule.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_bisect_bisect_right__doc__, "bisect_right($module, /, a, x, lo=0, hi=None, *, key=None)\n" @@ -35,8 +32,6 @@ static PyObject * _bisect_bisect_right(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -49,10 +44,6 @@ _bisect_bisect_right(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "x", "lo", "hi", "key", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -143,8 +134,6 @@ static PyObject * _bisect_insort_right(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -157,10 +146,6 @@ _bisect_insort_right(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "x", "lo", "hi", "key", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -248,8 +233,6 @@ static PyObject * _bisect_bisect_left(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -262,10 +245,6 @@ _bisect_bisect_left(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "x", "lo", "hi", "key", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -356,8 +335,6 @@ static PyObject * _bisect_insort_left(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -370,10 +347,6 @@ _bisect_insort_left(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "x", "lo", "hi", "key", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -434,4 +407,4 @@ _bisect_insort_left(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P exit: return return_value; } -/*[clinic end generated code: output=839fdddeacdc2ecb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=80ff8d8de7ae1e9c input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_bz2module.c.h b/Modules/clinic/_bz2module.c.h index 7c4d57b5fec7e10..3e7789b5bd2deba 100644 --- a/Modules/clinic/_bz2module.c.h +++ b/Modules/clinic/_bz2module.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_bz2_BZ2Compressor_compress__doc__, "compress($self, data, /)\n" @@ -144,8 +141,6 @@ static PyObject * _bz2_BZ2Decompressor_decompress(BZ2Decompressor *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -158,10 +153,6 @@ _bz2_BZ2Decompressor_decompress(BZ2Decompressor *self, PyObject *const *args, Py #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"data", "max_length", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -242,4 +233,4 @@ _bz2_BZ2Decompressor(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=40706688f92642b4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b83067c2f83c53c1 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_codecsmodule.c.h b/Modules/clinic/_codecsmodule.c.h index fc6dcaa76512878..f1232bc2d84a36a 100644 --- a/Modules/clinic/_codecsmodule.c.h +++ b/Modules/clinic/_codecsmodule.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_codecs_register__doc__, "register($module, search_function, /)\n" @@ -92,8 +89,6 @@ static PyObject * _codecs_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -106,10 +101,6 @@ _codecs_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"obj", "encoding", "errors", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -192,8 +183,6 @@ static PyObject * _codecs_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -206,10 +195,6 @@ _codecs_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"obj", "encoding", "errors", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2818,4 +2803,4 @@ _codecs_lookup_error(PyObject *module, PyObject *arg) #ifndef _CODECS_CODE_PAGE_ENCODE_METHODDEF #define _CODECS_CODE_PAGE_ENCODE_METHODDEF #endif /* !defined(_CODECS_CODE_PAGE_ENCODE_METHODDEF) */ -/*[clinic end generated code: output=6d9bc20c8dd36134 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=cfbf3f7db20f5371 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_collectionsmodule.c.h b/Modules/clinic/_collectionsmodule.c.h index b96502d3cf4b3f7..9dde2ca34f99909 100644 --- a/Modules/clinic/_collectionsmodule.c.h +++ b/Modules/clinic/_collectionsmodule.c.h @@ -2,11 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() PyDoc_STRVAR(_collections__count_elements__doc__, @@ -76,4 +71,4 @@ tuplegetter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=d83188040656ad7c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a0b14499fb854c60 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_contextvarsmodule.c.h b/Modules/clinic/_contextvarsmodule.c.h index 461d4845635ef06..b1885e41c355d27 100644 --- a/Modules/clinic/_contextvarsmodule.c.h +++ b/Modules/clinic/_contextvarsmodule.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_contextvars_copy_context__doc__, "copy_context($module, /)\n" "--\n" @@ -24,4 +18,4 @@ _contextvars_copy_context(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _contextvars_copy_context_impl(module); } -/*[clinic end generated code: output=1736c27450823e70 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=26e07024451baf52 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_csv.c.h b/Modules/clinic/_csv.c.h index 8900946350a524d..c862cbb637047fe 100644 --- a/Modules/clinic/_csv.c.h +++ b/Modules/clinic/_csv.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_csv_list_dialects__doc__, "list_dialects($module, /)\n" "--\n" @@ -46,23 +40,7 @@ static PyObject * _csv_unregister_dialect(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - - #define NUM_KEYWORDS 1 - static struct { - PyGC_Head _this_is_not_used; - PyObject_VAR_HEAD - PyObject *ob_item[NUM_KEYWORDS]; - } _kwtuple = { - .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) - .ob_item = { &_Py_ID(name), }, - }; - #undef NUM_KEYWORDS - #define KWTUPLE (&_kwtuple.ob_base.ob_base) - - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE + #define KWTUPLE NULL static const char * const _keywords[] = {"name", NULL}; static _PyArg_Parser _parser = { @@ -103,23 +81,7 @@ static PyObject * _csv_get_dialect(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - - #define NUM_KEYWORDS 1 - static struct { - PyGC_Head _this_is_not_used; - PyObject_VAR_HEAD - PyObject *ob_item[NUM_KEYWORDS]; - } _kwtuple = { - .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) - .ob_item = { &_Py_ID(name), }, - }; - #undef NUM_KEYWORDS - #define KWTUPLE (&_kwtuple.ob_base.ob_base) - - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE + #define KWTUPLE NULL static const char * const _keywords[] = {"name", NULL}; static _PyArg_Parser _parser = { @@ -163,23 +125,7 @@ static PyObject * _csv_field_size_limit(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - - #define NUM_KEYWORDS 1 - static struct { - PyGC_Head _this_is_not_used; - PyObject_VAR_HEAD - PyObject *ob_item[NUM_KEYWORDS]; - } _kwtuple = { - .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) - .ob_item = { &_Py_ID(new_limit), }, - }; - #undef NUM_KEYWORDS - #define KWTUPLE (&_kwtuple.ob_base.ob_base) - - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE + #define KWTUPLE NULL static const char * const _keywords[] = {"new_limit", NULL}; static _PyArg_Parser _parser = { @@ -206,4 +152,4 @@ _csv_field_size_limit(PyObject *module, PyObject *const *args, Py_ssize_t nargs, exit: return return_value; } -/*[clinic end generated code: output=94374e41eb2806ee input=a9049054013a1b77]*/ +/*[clinic end generated code: output=28a4fdb57e7c6656 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_curses_panel.c.h b/Modules/clinic/_curses_panel.c.h index 900058e6d59af09..a8c32c6aa3fc105 100644 --- a/Modules/clinic/_curses_panel.c.h +++ b/Modules/clinic/_curses_panel.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_curses_panel_panel_bottom__doc__, "bottom($self, /)\n" "--\n" @@ -422,4 +416,4 @@ _curses_panel_update_panels(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _curses_panel_update_panels_impl(module); } -/*[clinic end generated code: output=cb76cb1d5040f387 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=dd302cb9afc42f40 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_cursesmodule.c.h b/Modules/clinic/_cursesmodule.c.h index 836087581a73ba1..3112c73577bc6fe 100644 --- a/Modules/clinic/_cursesmodule.c.h +++ b/Modules/clinic/_cursesmodule.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_curses_window_addch__doc__, "addch([y, x,] ch, [attr=_curses.A_NORMAL])\n" @@ -2684,8 +2681,6 @@ static PyObject * _curses_setupterm(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -2698,10 +2693,6 @@ _curses_setupterm(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"term", "fd", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -4313,4 +4304,4 @@ _curses_has_extended_color_support(PyObject *module, PyObject *Py_UNUSED(ignored #ifndef _CURSES_USE_DEFAULT_COLORS_METHODDEF #define _CURSES_USE_DEFAULT_COLORS_METHODDEF #endif /* !defined(_CURSES_USE_DEFAULT_COLORS_METHODDEF) */ -/*[clinic end generated code: output=cff0e570de65d9b8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1a46389708c639ac input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_datetimemodule.c.h b/Modules/clinic/_datetimemodule.c.h index c058c13fcc06832..294afe8824a3f73 100644 --- a/Modules/clinic/_datetimemodule.c.h +++ b/Modules/clinic/_datetimemodule.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(datetime_date_fromtimestamp__doc__, "fromtimestamp($type, timestamp, /)\n" @@ -28,8 +25,6 @@ static PyObject * iso_calendar_date_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -42,10 +37,6 @@ iso_calendar_date_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"year", "week", "weekday", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -103,8 +94,6 @@ static PyObject * datetime_datetime_now(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -117,10 +106,6 @@ datetime_datetime_now(PyTypeObject *type, PyObject *const *args, Py_ssize_t narg #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"tz", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -146,4 +131,4 @@ datetime_datetime_now(PyTypeObject *type, PyObject *const *args, Py_ssize_t narg exit: return return_value; } -/*[clinic end generated code: output=720c99f24a9aa41c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f08872761f12dacf input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_dbmmodule.c.h b/Modules/clinic/_dbmmodule.c.h index fbf4ccf27c1f71a..a76b8b30eded39c 100644 --- a/Modules/clinic/_dbmmodule.c.h +++ b/Modules/clinic/_dbmmodule.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_dbm_dbm_close__doc__, "close($self, /)\n" "--\n" @@ -222,4 +216,4 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=f1bf74536f201669 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=972d221f9da819d3 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_elementtree.c.h b/Modules/clinic/_elementtree.c.h index 78e456b6a434635..f723a0cc90ed5a3 100644 --- a/Modules/clinic/_elementtree.c.h +++ b/Modules/clinic/_elementtree.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_elementtree_Element_append__doc__, "append($self, subelement, /)\n" @@ -268,8 +265,6 @@ static PyObject * _elementtree_Element_find(ElementObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -282,10 +277,6 @@ _elementtree_Element_find(ElementObject *self, PyTypeObject *cls, PyObject *cons #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "namespaces", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -331,8 +322,6 @@ static PyObject * _elementtree_Element_findtext(ElementObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -345,10 +334,6 @@ _elementtree_Element_findtext(ElementObject *self, PyTypeObject *cls, PyObject * #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "default", "namespaces", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -400,8 +385,6 @@ static PyObject * _elementtree_Element_findall(ElementObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -414,10 +397,6 @@ _elementtree_Element_findall(ElementObject *self, PyTypeObject *cls, PyObject *c #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "namespaces", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -462,8 +441,6 @@ static PyObject * _elementtree_Element_iterfind(ElementObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -476,10 +453,6 @@ _elementtree_Element_iterfind(ElementObject *self, PyTypeObject *cls, PyObject * #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "namespaces", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -524,8 +497,6 @@ static PyObject * _elementtree_Element_get(ElementObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -538,10 +509,6 @@ _elementtree_Element_get(ElementObject *self, PyObject *const *args, Py_ssize_t #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"key", "default", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -586,8 +553,6 @@ static PyObject * _elementtree_Element_iter(ElementObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -600,10 +565,6 @@ _elementtree_Element_iter(ElementObject *self, PyTypeObject *cls, PyObject *cons #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"tag", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -848,8 +809,6 @@ static int _elementtree_TreeBuilder___init__(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -862,10 +821,6 @@ _elementtree_TreeBuilder___init__(PyObject *self, PyObject *args, PyObject *kwar #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"element_factory", "comment_factory", "pi_factory", "insert_comments", "insert_pis", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1082,8 +1037,6 @@ static int _elementtree_XMLParser___init__(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -1096,10 +1049,6 @@ _elementtree_XMLParser___init__(PyObject *self, PyObject *args, PyObject *kwargs #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"target", "encoding", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1219,4 +1168,4 @@ _elementtree_XMLParser__setevents(XMLParserObject *self, PyObject *const *args, exit: return return_value; } -/*[clinic end generated code: output=0a34620406b95eb0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ae318e25931f94b0 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_functoolsmodule.c.h b/Modules/clinic/_functoolsmodule.c.h index 9c79e6430413bf8..64c7ce6d2a1680a 100644 --- a/Modules/clinic/_functoolsmodule.c.h +++ b/Modules/clinic/_functoolsmodule.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_functools_cmp_to_key__doc__, "cmp_to_key($module, /, mycmp)\n" @@ -27,8 +24,6 @@ static PyObject * _functools_cmp_to_key(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -41,10 +36,6 @@ _functools_cmp_to_key(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"mycmp", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -101,4 +92,4 @@ _functools__lru_cache_wrapper_cache_clear(PyObject *self, PyObject *Py_UNUSED(ig { return _functools__lru_cache_wrapper_cache_clear_impl(self); } -/*[clinic end generated code: output=7e7f3bcf9ed61f23 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=55deb7d6cbd42a86 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_gdbmmodule.c.h b/Modules/clinic/_gdbmmodule.c.h index 73e2d7934213ee4..e9138bbf0430c5c 100644 --- a/Modules/clinic/_gdbmmodule.c.h +++ b/Modules/clinic/_gdbmmodule.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_gdbm_gdbm_get__doc__, "get($self, key, default=None, /)\n" "--\n" @@ -344,4 +338,4 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=cf48d9f76fdd62b9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=84f30c7fff0eadac input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_hashopenssl.c.h b/Modules/clinic/_hashopenssl.c.h index 0ea192eac2d3f17..f5d89346d3b8c15 100644 --- a/Modules/clinic/_hashopenssl.c.h +++ b/Modules/clinic/_hashopenssl.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(EVP_copy__doc__, "copy($self, /)\n" @@ -90,8 +87,6 @@ static PyObject * EVPXOF_digest(EVPobject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -104,10 +99,6 @@ EVPXOF_digest(EVPobject *self, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"length", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -160,8 +151,6 @@ static PyObject * EVPXOF_hexdigest(EVPobject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -174,10 +163,6 @@ EVPXOF_hexdigest(EVPobject *self, PyObject *const *args, Py_ssize_t nargs, PyObj #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"length", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -234,8 +219,6 @@ static PyObject * EVP_new(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -248,10 +231,6 @@ EVP_new(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwn #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"name", "string", "usedforsecurity", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -311,8 +290,6 @@ static PyObject * _hashlib_openssl_md5(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -325,10 +302,6 @@ _hashlib_openssl_md5(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "usedforsecurity", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -386,8 +359,6 @@ static PyObject * _hashlib_openssl_sha1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -400,10 +371,6 @@ _hashlib_openssl_sha1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "usedforsecurity", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -461,8 +428,6 @@ static PyObject * _hashlib_openssl_sha224(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -475,10 +440,6 @@ _hashlib_openssl_sha224(PyObject *module, PyObject *const *args, Py_ssize_t narg #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "usedforsecurity", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -536,8 +497,6 @@ static PyObject * _hashlib_openssl_sha256(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -550,10 +509,6 @@ _hashlib_openssl_sha256(PyObject *module, PyObject *const *args, Py_ssize_t narg #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "usedforsecurity", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -611,8 +566,6 @@ static PyObject * _hashlib_openssl_sha384(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -625,10 +578,6 @@ _hashlib_openssl_sha384(PyObject *module, PyObject *const *args, Py_ssize_t narg #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "usedforsecurity", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -686,8 +635,6 @@ static PyObject * _hashlib_openssl_sha512(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -700,10 +647,6 @@ _hashlib_openssl_sha512(PyObject *module, PyObject *const *args, Py_ssize_t narg #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "usedforsecurity", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -763,8 +706,6 @@ static PyObject * _hashlib_openssl_sha3_224(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -777,10 +718,6 @@ _hashlib_openssl_sha3_224(PyObject *module, PyObject *const *args, Py_ssize_t na #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "usedforsecurity", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -842,8 +779,6 @@ static PyObject * _hashlib_openssl_sha3_256(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -856,10 +791,6 @@ _hashlib_openssl_sha3_256(PyObject *module, PyObject *const *args, Py_ssize_t na #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "usedforsecurity", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -921,8 +852,6 @@ static PyObject * _hashlib_openssl_sha3_384(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -935,10 +864,6 @@ _hashlib_openssl_sha3_384(PyObject *module, PyObject *const *args, Py_ssize_t na #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "usedforsecurity", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1000,8 +925,6 @@ static PyObject * _hashlib_openssl_sha3_512(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -1014,10 +937,6 @@ _hashlib_openssl_sha3_512(PyObject *module, PyObject *const *args, Py_ssize_t na #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "usedforsecurity", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1079,8 +998,6 @@ static PyObject * _hashlib_openssl_shake_128(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -1093,10 +1010,6 @@ _hashlib_openssl_shake_128(PyObject *module, PyObject *const *args, Py_ssize_t n #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "usedforsecurity", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1158,8 +1071,6 @@ static PyObject * _hashlib_openssl_shake_256(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -1172,10 +1083,6 @@ _hashlib_openssl_shake_256(PyObject *module, PyObject *const *args, Py_ssize_t n #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "usedforsecurity", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1237,8 +1144,6 @@ static PyObject * pbkdf2_hmac(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -1251,10 +1156,6 @@ pbkdf2_hmac(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"hash_name", "password", "salt", "iterations", "dklen", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1346,8 +1247,6 @@ static PyObject * _hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 7 static struct { PyGC_Head _this_is_not_used; @@ -1360,10 +1259,6 @@ _hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"password", "salt", "n", "r", "p", "maxmem", "dklen", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1485,8 +1380,6 @@ static PyObject * _hashlib_hmac_singleshot(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -1499,10 +1392,6 @@ _hashlib_hmac_singleshot(PyObject *module, PyObject *const *args, Py_ssize_t nar #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"key", "msg", "digest", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1566,8 +1455,6 @@ static PyObject * _hashlib_hmac_new(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -1580,10 +1467,6 @@ _hashlib_hmac_new(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"key", "msg", "digestmod", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1664,8 +1547,6 @@ static PyObject * _hashlib_HMAC_update(HMACobject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1678,10 +1559,6 @@ _hashlib_HMAC_update(HMACobject *self, PyObject *const *args, Py_ssize_t nargs, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"msg", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1852,4 +1729,4 @@ _hashlib_compare_digest(PyObject *module, PyObject *const *args, Py_ssize_t narg #ifndef _HASHLIB_SCRYPT_METHODDEF #define _HASHLIB_SCRYPT_METHODDEF #endif /* !defined(_HASHLIB_SCRYPT_METHODDEF) */ -/*[clinic end generated code: output=cfad8d5e904a4917 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8385f1b36b90c20c input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_heapqmodule.c.h b/Modules/clinic/_heapqmodule.c.h index 3ee3f51702fa308..8d73b5b48d6a0ec 100644 --- a/Modules/clinic/_heapqmodule.c.h +++ b/Modules/clinic/_heapqmodule.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_heapq_heappush__doc__, "heappush($module, heap, item, /)\n" "--\n" @@ -271,4 +265,4 @@ _heapq__heapify_max(PyObject *module, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=29e99a48c57f82bb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9a22715a8bf0c91d input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_localemodule.c.h b/Modules/clinic/_localemodule.c.h index 18cf5025012e7c3..efbb9f709958cd6 100644 --- a/Modules/clinic/_localemodule.c.h +++ b/Modules/clinic/_localemodule.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_locale_setlocale__doc__, "setlocale($module, category, locale=, /)\n" "--\n" @@ -599,4 +593,4 @@ _locale_getencoding(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef _LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF #define _LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF #endif /* !defined(_LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF) */ -/*[clinic end generated code: output=119644f17919234d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3abe7fade999eff6 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_lsprof.c.h b/Modules/clinic/_lsprof.c.h index 5fcc7ae02e3b00d..dfc003eb54774ca 100644 --- a/Modules/clinic/_lsprof.c.h +++ b/Modules/clinic/_lsprof.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_lsprof_Profiler_getstats__doc__, "getstats($self, /)\n" "--\n" @@ -51,4 +45,4 @@ _lsprof_Profiler_getstats(ProfilerObject *self, PyTypeObject *cls, PyObject *con } return _lsprof_Profiler_getstats_impl(self, cls); } -/*[clinic end generated code: output=7425d3481349629a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0615a53cce828f06 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_lzmamodule.c.h b/Modules/clinic/_lzmamodule.c.h index ceb75399157627e..6c68ed993c9fcfa 100644 --- a/Modules/clinic/_lzmamodule.c.h +++ b/Modules/clinic/_lzmamodule.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_lzma_LZMACompressor_compress__doc__, "compress($self, data, /)\n" @@ -102,8 +99,6 @@ static PyObject * _lzma_LZMADecompressor_decompress(Decompressor *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -116,10 +111,6 @@ _lzma_LZMADecompressor_decompress(Decompressor *self, PyObject *const *args, Py_ #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"data", "max_length", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -201,8 +192,6 @@ static PyObject * _lzma_LZMADecompressor(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -215,10 +204,6 @@ _lzma_LZMADecompressor(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"format", "memlimit", "filters", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -339,4 +324,4 @@ _lzma__decode_filter_properties(PyObject *module, PyObject *const *args, Py_ssiz return return_value; } -/*[clinic end generated code: output=f1a001f5f489c372 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e552f8a0086e885c input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_opcode.c.h b/Modules/clinic/_opcode.c.h index f8e6a0a54f940cb..c06c44a7bbb1003 100644 --- a/Modules/clinic/_opcode.c.h +++ b/Modules/clinic/_opcode.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_opcode_stack_effect__doc__, "stack_effect($module, opcode, oparg=None, /, *, jump=None)\n" @@ -25,8 +22,6 @@ static PyObject * _opcode_stack_effect(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -39,10 +34,6 @@ _opcode_stack_effect(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "", "jump", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -102,8 +93,6 @@ static PyObject * _opcode_is_valid(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -116,10 +105,6 @@ _opcode_is_valid(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"opcode", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -165,8 +150,6 @@ static PyObject * _opcode_has_arg(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -179,10 +162,6 @@ _opcode_has_arg(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"opcode", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -228,8 +207,6 @@ static PyObject * _opcode_has_const(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -242,10 +219,6 @@ _opcode_has_const(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"opcode", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -291,8 +264,6 @@ static PyObject * _opcode_has_name(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -305,10 +276,6 @@ _opcode_has_name(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"opcode", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -354,8 +321,6 @@ static PyObject * _opcode_has_jump(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -368,10 +333,6 @@ _opcode_has_jump(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"opcode", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -422,8 +383,6 @@ static PyObject * _opcode_has_free(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -436,10 +395,6 @@ _opcode_has_free(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"opcode", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -485,8 +440,6 @@ static PyObject * _opcode_has_local(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -499,10 +452,6 @@ _opcode_has_local(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"opcode", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -548,8 +497,6 @@ static PyObject * _opcode_has_exc(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -562,10 +509,6 @@ _opcode_has_exc(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"opcode", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -668,4 +611,4 @@ _opcode_get_intrinsic2_descs(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _opcode_get_intrinsic2_descs_impl(module); } -/*[clinic end generated code: output=ce89aee80dd825d2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=cbcaec5e4fd7a5e8 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_operator.c.h b/Modules/clinic/_operator.c.h index 18b0b920b0d1186..55664e82ba11600 100644 --- a/Modules/clinic/_operator.c.h +++ b/Modules/clinic/_operator.c.h @@ -2,11 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() PyDoc_STRVAR(_operator_truth__doc__, @@ -1493,4 +1488,4 @@ _operator__compare_digest(PyObject *module, PyObject *const *args, Py_ssize_t na exit: return return_value; } -/*[clinic end generated code: output=72bc63a775937245 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=dc9d470ed61dcdda input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_pickle.c.h b/Modules/clinic/_pickle.c.h index 539acc34a05cc19..a1a4ff347843abf 100644 --- a/Modules/clinic/_pickle.c.h +++ b/Modules/clinic/_pickle.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_pickle_Pickler_clear_memo__doc__, "clear_memo($self, /)\n" @@ -147,8 +144,6 @@ static int _pickle_Pickler___init__(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -161,10 +156,6 @@ _pickle_Pickler___init__(PyObject *self, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"file", "protocol", "fix_imports", "buffer_callback", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -409,8 +400,6 @@ static int _pickle_Unpickler___init__(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -423,10 +412,6 @@ _pickle_Unpickler___init__(PyObject *self, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"file", "fix_imports", "encoding", "errors", "buffers", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -603,8 +588,6 @@ static PyObject * _pickle_dump(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -617,10 +600,6 @@ _pickle_dump(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"obj", "file", "protocol", "fix_imports", "buffer_callback", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -707,8 +686,6 @@ static PyObject * _pickle_dumps(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -721,10 +698,6 @@ _pickle_dumps(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"obj", "protocol", "fix_imports", "buffer_callback", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -815,8 +788,6 @@ static PyObject * _pickle_load(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -829,10 +800,6 @@ _pickle_load(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"file", "fix_imports", "encoding", "errors", "buffers", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -941,8 +908,6 @@ static PyObject * _pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -955,10 +920,6 @@ _pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "fix_imports", "encoding", "errors", "buffers", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1034,4 +995,4 @@ _pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec exit: return return_value; } -/*[clinic end generated code: output=a0e04b85e7bae626 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0eac9d9a752ed4df input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_posixsubprocess.c.h b/Modules/clinic/_posixsubprocess.c.h index 3b19a47e716492b..83048a385d319cf 100644 --- a/Modules/clinic/_posixsubprocess.c.h +++ b/Modules/clinic/_posixsubprocess.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(subprocess_fork_exec__doc__, "fork_exec($module, args, executable_list, close_fds, pass_fds, cwd,\n" " env, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite,\n" @@ -159,4 +153,4 @@ subprocess_fork_exec(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=be0e9b5d8c0217fa input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a83b11467169b97b input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_queuemodule.c.h b/Modules/clinic/_queuemodule.c.h index 94fb59a5b17a490..17daf7928a64e8f 100644 --- a/Modules/clinic/_queuemodule.c.h +++ b/Modules/clinic/_queuemodule.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(simplequeue_new__doc__, "SimpleQueue()\n" @@ -57,8 +54,6 @@ static PyObject * _queue_SimpleQueue_put(simplequeueobject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -71,10 +66,6 @@ _queue_SimpleQueue_put(simplequeueobject *self, PyObject *const *args, Py_ssize_ #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"item", "block", "timeout", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -132,8 +123,6 @@ static PyObject * _queue_SimpleQueue_put_nowait(simplequeueobject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -146,10 +135,6 @@ _queue_SimpleQueue_put_nowait(simplequeueobject *self, PyObject *const *args, Py #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"item", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -196,8 +181,6 @@ static PyObject * _queue_SimpleQueue_get(simplequeueobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -210,10 +193,6 @@ _queue_SimpleQueue_get(simplequeueobject *self, PyTypeObject *cls, PyObject *con #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"block", "timeout", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -331,4 +310,4 @@ _queue_SimpleQueue_qsize(simplequeueobject *self, PyObject *Py_UNUSED(ignored)) exit: return return_value; } -/*[clinic end generated code: output=9a72a8d1b5767f6a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3fc02d6168796d9e input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_randommodule.c.h b/Modules/clinic/_randommodule.c.h index 45f06b60ed44485..008b531d832c5ad 100644 --- a/Modules/clinic/_randommodule.c.h +++ b/Modules/clinic/_randommodule.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_random_Random_random__doc__, "random($self, /)\n" "--\n" @@ -115,4 +109,4 @@ _random_Random_getrandbits(RandomObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=3feabc783b317d0d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5e7e05d756a7e1c7 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_ssl.c.h b/Modules/clinic/_ssl.c.h index 6ab8e3ee436336f..eac45f1d239ed87 100644 --- a/Modules/clinic/_ssl.c.h +++ b/Modules/clinic/_ssl.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_ssl__SSLSocket_do_handshake__doc__, "do_handshake($self, /)\n" @@ -355,8 +352,6 @@ static PyObject * _ssl__SSLSocket_get_channel_binding(PySSLSocket *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -369,10 +364,6 @@ _ssl__SSLSocket_get_channel_binding(PySSLSocket *self, PyObject *const *args, Py #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"cb_type", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -561,8 +552,6 @@ static PyObject * _ssl__SSLContext_load_cert_chain(PySSLContext *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -575,10 +564,6 @@ _ssl__SSLContext_load_cert_chain(PySSLContext *self, PyObject *const *args, Py_s #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"certfile", "keyfile", "password", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -632,8 +617,6 @@ static PyObject * _ssl__SSLContext_load_verify_locations(PySSLContext *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -646,10 +629,6 @@ _ssl__SSLContext_load_verify_locations(PySSLContext *self, PyObject *const *args #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"cafile", "capath", "cadata", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -716,8 +695,6 @@ static PyObject * _ssl__SSLContext__wrap_socket(PySSLContext *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -730,10 +707,6 @@ _ssl__SSLContext__wrap_socket(PySSLContext *self, PyObject *const *args, Py_ssiz #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"sock", "server_side", "server_hostname", "owner", "session", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -808,8 +781,6 @@ static PyObject * _ssl__SSLContext__wrap_bio(PySSLContext *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 6 static struct { PyGC_Head _this_is_not_used; @@ -822,10 +793,6 @@ _ssl__SSLContext__wrap_bio(PySSLContext *self, PyObject *const *args, Py_ssize_t #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"incoming", "outgoing", "server_side", "server_hostname", "owner", "session", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -975,8 +942,6 @@ static PyObject * _ssl__SSLContext_get_ca_certs(PySSLContext *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -989,10 +954,6 @@ _ssl__SSLContext_get_ca_certs(PySSLContext *self, PyObject *const *args, Py_ssiz #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"binary_form", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1294,8 +1255,6 @@ static PyObject * _ssl_txt2obj(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -1308,10 +1267,6 @@ _ssl_txt2obj(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"txt", "name", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1407,8 +1362,6 @@ static PyObject * _ssl_enum_certificates(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1421,10 +1374,6 @@ _ssl_enum_certificates(PyObject *module, PyObject *const *args, Py_ssize_t nargs #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"store_name", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1483,8 +1432,6 @@ static PyObject * _ssl_enum_crls(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1497,10 +1444,6 @@ _ssl_enum_crls(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"store_name", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1543,4 +1486,4 @@ _ssl_enum_crls(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #ifndef _SSL_ENUM_CRLS_METHODDEF #define _SSL_ENUM_CRLS_METHODDEF #endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */ -/*[clinic end generated code: output=6e2eb86330f3f9b8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=98daa100a672e040 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_statisticsmodule.c.h b/Modules/clinic/_statisticsmodule.c.h index 4dedadd2939ad66..03543e41af7f5a0 100644 --- a/Modules/clinic/_statisticsmodule.c.h +++ b/Modules/clinic/_statisticsmodule.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_statistics__normal_dist_inv_cdf__doc__, "_normal_dist_inv_cdf($module, p, mu, sigma, /)\n" "--\n" @@ -71,4 +65,4 @@ _statistics__normal_dist_inv_cdf(PyObject *module, PyObject *const *args, Py_ssi exit: return return_value; } -/*[clinic end generated code: output=6899dc752cc6b457 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b807a8243e7801e6 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_struct.c.h b/Modules/clinic/_struct.c.h index a823364447818bc..e145e9dd752b1f0 100644 --- a/Modules/clinic/_struct.c.h +++ b/Modules/clinic/_struct.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(Struct__doc__, "Struct(format)\n" @@ -27,8 +24,6 @@ static PyObject * Struct(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -41,10 +36,6 @@ Struct(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"format", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -133,8 +124,6 @@ static PyObject * Struct_unpack_from(PyStructObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -147,10 +136,6 @@ Struct_unpack_from(PyStructObject *self, PyObject *const *args, Py_ssize_t nargs #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"buffer", "offset", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -338,8 +323,6 @@ static PyObject * unpack_from(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -352,10 +335,6 @@ unpack_from(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "buffer", "offset", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -452,4 +431,4 @@ iter_unpack(PyObject *module, PyObject *const *args, Py_ssize_t nargs) return return_value; } -/*[clinic end generated code: output=9b48aeaa86898ec5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3356a92109d8fd31 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_testclinic.c.h b/Modules/clinic/_testclinic.c.h index 94c4b5a1221eecc..cab9e2a16bbed77 100644 --- a/Modules/clinic/_testclinic.c.h +++ b/Modules/clinic/_testclinic.c.h @@ -2,13 +2,10 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() +#include "pycore_gc.h" // PyGC_Head #include "pycore_long.h" // _PyLong_UnsignedShort_Converter() +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(test_empty_function__doc__, "test_empty_function($module, /)\n" @@ -1250,8 +1247,6 @@ static PyObject * keywords(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -1264,10 +1259,6 @@ keywords(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1306,8 +1297,6 @@ static PyObject * keywords_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -1320,10 +1309,6 @@ keywords_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1362,8 +1347,6 @@ static PyObject * keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -1376,10 +1359,6 @@ keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", "c", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1431,8 +1410,6 @@ static PyObject * keywords_opt_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -1445,10 +1422,6 @@ keywords_opt_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", "c", "d", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1511,8 +1484,6 @@ static PyObject * keywords_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -1525,10 +1496,6 @@ keywords_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", "c", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1579,8 +1546,6 @@ static PyObject * posonly_keywords(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1593,10 +1558,6 @@ posonly_keywords(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1635,8 +1596,6 @@ static PyObject * posonly_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1649,10 +1608,6 @@ posonly_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1692,8 +1647,6 @@ static PyObject * posonly_keywords_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -1706,10 +1659,6 @@ posonly_keywords_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t narg #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", "c", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1751,8 +1700,6 @@ static PyObject * posonly_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -1765,10 +1712,6 @@ posonly_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", "c", "d", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1822,8 +1765,6 @@ static PyObject * posonly_opt_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -1836,10 +1777,6 @@ posonly_opt_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nar #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "", "c", "d", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1898,8 +1835,6 @@ static PyObject * posonly_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -1912,10 +1847,6 @@ posonly_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, Py #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", "c", "d", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1969,8 +1900,6 @@ static PyObject * posonly_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -1983,10 +1912,6 @@ posonly_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "", "c", "d", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2045,8 +1970,6 @@ static PyObject * posonly_keywords_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -2059,10 +1982,6 @@ posonly_keywords_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", "c", "d", "e", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2120,8 +2039,6 @@ static PyObject * posonly_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -2134,10 +2051,6 @@ posonly_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssiz #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", "c", "d", "e", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2204,8 +2117,6 @@ static PyObject * posonly_opt_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -2218,10 +2129,6 @@ posonly_opt_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "", "c", "d", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2283,8 +2190,6 @@ static PyObject * keyword_only_parameter(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -2297,10 +2202,6 @@ keyword_only_parameter(PyObject *module, PyObject *const *args, Py_ssize_t nargs #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2338,8 +2239,6 @@ static PyObject * posonly_vararg(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -2352,10 +2251,6 @@ posonly_vararg(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2433,8 +2328,6 @@ static PyObject * vararg(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -2447,10 +2340,6 @@ vararg(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwna #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2491,8 +2380,6 @@ static PyObject * vararg_with_default(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -2505,10 +2392,6 @@ vararg_with_default(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2558,8 +2441,6 @@ static PyObject * vararg_with_only_defaults(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -2572,10 +2453,6 @@ vararg_with_only_defaults(PyObject *module, PyObject *const *args, Py_ssize_t na #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2622,8 +2499,6 @@ static PyObject * gh_32092_oob(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -2636,10 +2511,6 @@ gh_32092_oob(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"pos1", "pos2", "kw1", "kw2", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2697,8 +2568,6 @@ static PyObject * gh_32092_kw_pass(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -2711,10 +2580,6 @@ gh_32092_kw_pass(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"pos", "kw", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2829,8 +2694,6 @@ static PyObject * clone_f1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -2843,10 +2706,6 @@ clone_f1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2895,8 +2754,6 @@ static PyObject * clone_f2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -2909,10 +2766,6 @@ clone_f2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2961,8 +2814,6 @@ static PyObject * clone_with_conv_f1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -2975,10 +2826,6 @@ clone_with_conv_f1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, Py #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -3024,8 +2871,6 @@ static PyObject * clone_with_conv_f2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -3038,10 +2883,6 @@ clone_with_conv_f2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, Py #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -3071,4 +2912,4 @@ clone_with_conv_f2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, Py exit: return return_value; } -/*[clinic end generated code: output=a652e6b1787d3346 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9420ef9b53b48cca input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_testclinic_depr.c.h b/Modules/clinic/_testclinic_depr.c.h index 7b9d8971efb46be..83355e5b71b7a82 100644 --- a/Modules/clinic/_testclinic_depr.c.h +++ b/Modules/clinic/_testclinic_depr.c.h @@ -2,13 +2,10 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() +#include "pycore_gc.h" // PyGC_Head #include "pycore_long.h" // _PyLong_UnsignedShort_Converter() +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(depr_star_new__doc__, "DeprStarNew(a=None)\n" @@ -39,8 +36,6 @@ static PyObject * depr_star_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -53,10 +48,6 @@ depr_star_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -124,8 +115,6 @@ static PyObject * depr_star_new_clone(PyObject *type, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -138,10 +127,6 @@ depr_star_new_clone(PyObject *type, PyObject *const *args, Py_ssize_t nargs, PyO #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -206,8 +191,6 @@ static int depr_star_init(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -220,10 +203,6 @@ depr_star_init(PyObject *self, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -291,8 +270,6 @@ static PyObject * depr_star_init_clone(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -305,10 +282,6 @@ depr_star_init_clone(PyObject *self, PyObject *const *args, Py_ssize_t nargs, Py #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -363,8 +336,6 @@ static int depr_star_init_noinline(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -377,10 +348,6 @@ depr_star_init_noinline(PyObject *self, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", "c", "d", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -442,8 +409,6 @@ static PyObject * depr_kwd_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -456,10 +421,6 @@ depr_kwd_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -525,8 +486,6 @@ static int depr_kwd_init(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -539,10 +498,6 @@ depr_kwd_init(PyObject *self, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -599,8 +554,6 @@ static int depr_kwd_init_noinline(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -613,10 +566,6 @@ depr_kwd_init_noinline(PyObject *self, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", "c", "d", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -683,8 +632,6 @@ static PyObject * depr_star_pos0_len1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -697,10 +644,6 @@ depr_star_pos0_len1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -761,8 +704,6 @@ static PyObject * depr_star_pos0_len2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -775,10 +716,6 @@ depr_star_pos0_len2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -842,8 +779,6 @@ static PyObject * depr_star_pos0_len3_with_kwd(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -856,10 +791,6 @@ depr_star_pos0_len3_with_kwd(PyObject *module, PyObject *const *args, Py_ssize_t #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", "c", "d", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -926,8 +857,6 @@ static PyObject * depr_star_pos1_len1_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -940,10 +869,6 @@ depr_star_pos1_len1_opt(PyObject *module, PyObject *const *args, Py_ssize_t narg #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1011,8 +936,6 @@ static PyObject * depr_star_pos1_len1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -1025,10 +948,6 @@ depr_star_pos1_len1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1092,8 +1011,6 @@ static PyObject * depr_star_pos1_len2_with_kwd(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -1106,10 +1023,6 @@ depr_star_pos1_len2_with_kwd(PyObject *module, PyObject *const *args, Py_ssize_t #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", "c", "d", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1177,8 +1090,6 @@ static PyObject * depr_star_pos2_len1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -1191,10 +1102,6 @@ depr_star_pos2_len1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", "c", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1260,8 +1167,6 @@ static PyObject * depr_star_pos2_len2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -1274,10 +1179,6 @@ depr_star_pos2_len2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", "c", "d", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1345,8 +1246,6 @@ static PyObject * depr_star_pos2_len2_with_kwd(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -1359,10 +1258,6 @@ depr_star_pos2_len2_with_kwd(PyObject *module, PyObject *const *args, Py_ssize_t #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", "c", "d", "e", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1432,8 +1327,6 @@ static PyObject * depr_star_noinline(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -1446,10 +1339,6 @@ depr_star_noinline(PyObject *module, PyObject *const *args, Py_ssize_t nargs, Py #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", "c", "d", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1516,8 +1405,6 @@ static PyObject * depr_star_multi(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 8 static struct { PyGC_Head _this_is_not_used; @@ -1530,10 +1417,6 @@ depr_star_multi(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", "c", "d", "e", "f", "g", "h", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1609,8 +1492,6 @@ static PyObject * depr_kwd_required_1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1623,10 +1504,6 @@ depr_kwd_required_1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1690,8 +1567,6 @@ static PyObject * depr_kwd_required_2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -1704,10 +1579,6 @@ depr_kwd_required_2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", "c", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1771,8 +1642,6 @@ static PyObject * depr_kwd_optional_1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1785,10 +1654,6 @@ depr_kwd_optional_1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1857,8 +1722,6 @@ static PyObject * depr_kwd_optional_2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -1871,10 +1734,6 @@ depr_kwd_optional_2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", "c", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1950,8 +1809,6 @@ static PyObject * depr_kwd_optional_3(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -1964,10 +1821,6 @@ depr_kwd_optional_3(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", "c", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2048,8 +1901,6 @@ static PyObject * depr_kwd_required_optional(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -2062,10 +1913,6 @@ depr_kwd_required_optional(PyObject *module, PyObject *const *args, Py_ssize_t n #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", "c", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2136,8 +1983,6 @@ static PyObject * depr_kwd_noinline(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -2150,10 +1995,6 @@ depr_kwd_noinline(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", "c", "d", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2223,8 +2064,6 @@ static PyObject * depr_kwd_multi(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 7 static struct { PyGC_Head _this_is_not_used; @@ -2237,10 +2076,6 @@ depr_kwd_multi(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", "c", "d", "e", "f", "g", "h", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2324,8 +2159,6 @@ static PyObject * depr_multi(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 6 static struct { PyGC_Head _this_is_not_used; @@ -2338,10 +2171,6 @@ depr_multi(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "b", "c", "d", "e", "f", "g", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2393,4 +2222,4 @@ depr_multi(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * exit: return return_value; } -/*[clinic end generated code: output=464aeba97e482f5c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=80eecb5ba1621049 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_testinternalcapi.c.h b/Modules/clinic/_testinternalcapi.c.h index 72a5f1660996594..c84dc7c0613398a 100644 --- a/Modules/clinic/_testinternalcapi.c.h +++ b/Modules/clinic/_testinternalcapi.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_testinternalcapi_compiler_cleandoc__doc__, "compiler_cleandoc($module, /, doc)\n" "--\n" @@ -24,23 +18,7 @@ static PyObject * _testinternalcapi_compiler_cleandoc(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - - #define NUM_KEYWORDS 1 - static struct { - PyGC_Head _this_is_not_used; - PyObject_VAR_HEAD - PyObject *ob_item[NUM_KEYWORDS]; - } _kwtuple = { - .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) - .ob_item = { &_Py_ID(doc), }, - }; - #undef NUM_KEYWORDS - #define KWTUPLE (&_kwtuple.ob_base.ob_base) - - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE + #define KWTUPLE NULL static const char * const _keywords[] = {"doc", NULL}; static _PyArg_Parser _parser = { @@ -85,23 +63,7 @@ static PyObject * _testinternalcapi_compiler_codegen(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - - #define NUM_KEYWORDS 4 - static struct { - PyGC_Head _this_is_not_used; - PyObject_VAR_HEAD - PyObject *ob_item[NUM_KEYWORDS]; - } _kwtuple = { - .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) - .ob_item = { &_Py_ID(ast), &_Py_ID(filename), &_Py_ID(optimize), &_Py_ID(compile_mode), }, - }; - #undef NUM_KEYWORDS - #define KWTUPLE (&_kwtuple.ob_base.ob_base) - - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE + #define KWTUPLE NULL static const char * const _keywords[] = {"ast", "filename", "optimize", "compile_mode", NULL}; static _PyArg_Parser _parser = { @@ -158,23 +120,7 @@ static PyObject * _testinternalcapi_optimize_cfg(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - - #define NUM_KEYWORDS 3 - static struct { - PyGC_Head _this_is_not_used; - PyObject_VAR_HEAD - PyObject *ob_item[NUM_KEYWORDS]; - } _kwtuple = { - .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) - .ob_item = { &_Py_ID(instructions), &_Py_ID(consts), &_Py_ID(nlocals), }, - }; - #undef NUM_KEYWORDS - #define KWTUPLE (&_kwtuple.ob_base.ob_base) - - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE + #define KWTUPLE NULL static const char * const _keywords[] = {"instructions", "consts", "nlocals", NULL}; static _PyArg_Parser _parser = { @@ -223,23 +169,7 @@ static PyObject * _testinternalcapi_assemble_code_object(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - - #define NUM_KEYWORDS 3 - static struct { - PyGC_Head _this_is_not_used; - PyObject_VAR_HEAD - PyObject *ob_item[NUM_KEYWORDS]; - } _kwtuple = { - .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) - .ob_item = { &_Py_ID(filename), &_Py_ID(instructions), &_Py_ID(metadata), }, - }; - #undef NUM_KEYWORDS - #define KWTUPLE (&_kwtuple.ob_base.ob_base) - - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE + #define KWTUPLE NULL static const char * const _keywords[] = {"filename", "instructions", "metadata", NULL}; static _PyArg_Parser _parser = { @@ -265,4 +195,4 @@ _testinternalcapi_assemble_code_object(PyObject *module, PyObject *const *args, exit: return return_value; } -/*[clinic end generated code: output=1ce6e2257e95a853 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=780eb898aef50c30 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_testmultiphase.c.h b/Modules/clinic/_testmultiphase.c.h index f7b99b1c52f0a98..071f0e74b745c9f 100644 --- a/Modules/clinic/_testmultiphase.c.h +++ b/Modules/clinic/_testmultiphase.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_testmultiphase_StateAccessType_get_defining_module__doc__, "get_defining_module($self, /)\n" "--\n" @@ -79,23 +73,7 @@ static PyObject * _testmultiphase_StateAccessType_increment_count_clinic(StateAccessTypeObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - - #define NUM_KEYWORDS 2 - static struct { - PyGC_Head _this_is_not_used; - PyObject_VAR_HEAD - PyObject *ob_item[NUM_KEYWORDS]; - } _kwtuple = { - .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) - .ob_item = { &_Py_ID(n), &_Py_ID(twice), }, - }; - #undef NUM_KEYWORDS - #define KWTUPLE (&_kwtuple.ob_base.ob_base) - - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE + #define KWTUPLE NULL static const char * const _keywords[] = {"n", "twice", NULL}; static _PyArg_Parser _parser = { @@ -162,4 +140,4 @@ _testmultiphase_StateAccessType_get_count(StateAccessTypeObject *self, PyTypeObj } return _testmultiphase_StateAccessType_get_count_impl(self, cls); } -/*[clinic end generated code: output=6f8db3983c5312a0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=49bd84e1ff6d8608 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_tkinter.c.h b/Modules/clinic/_tkinter.c.h index e588ea6989c672b..fcfc406238808be 100644 --- a/Modules/clinic/_tkinter.c.h +++ b/Modules/clinic/_tkinter.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_tkinter_tkapp_eval__doc__, "eval($self, script, /)\n" "--\n" @@ -865,4 +859,4 @@ _tkinter_getbusywaitinterval(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF #define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF #endif /* !defined(_TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF) */ -/*[clinic end generated code: output=2cdb2fd0ce66ebe5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=bcd9cdc8f6bdcfae input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_tracemalloc.c.h b/Modules/clinic/_tracemalloc.c.h index aa4fe84939aaa2f..c07ad797d6295bb 100644 --- a/Modules/clinic/_tracemalloc.c.h +++ b/Modules/clinic/_tracemalloc.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_tracemalloc_is_tracing__doc__, "is_tracing($module, /)\n" "--\n" @@ -218,4 +212,4 @@ _tracemalloc_reset_peak(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _tracemalloc_reset_peak_impl(module); } -/*[clinic end generated code: output=98a42e95af7eaf09 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ad7d1fae89f2bdaa input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_typingmodule.c.h b/Modules/clinic/_typingmodule.c.h index f980aa0d0844da5..ea415e67153ed86 100644 --- a/Modules/clinic/_typingmodule.c.h +++ b/Modules/clinic/_typingmodule.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_typing__idfunc__doc__, "_idfunc($module, x, /)\n" "--\n" @@ -15,4 +9,4 @@ PyDoc_STRVAR(_typing__idfunc__doc__, #define _TYPING__IDFUNC_METHODDEF \ {"_idfunc", (PyCFunction)_typing__idfunc, METH_O, _typing__idfunc__doc__}, -/*[clinic end generated code: output=97457fda45072c7d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e7ea2a3cb7ab301a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_weakref.c.h b/Modules/clinic/_weakref.c.h index 48feb042cac0390..541cba75e6813c8 100644 --- a/Modules/clinic/_weakref.c.h +++ b/Modules/clinic/_weakref.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_weakref_getweakrefcount__doc__, "getweakrefcount($module, object, /)\n" "--\n" @@ -116,4 +110,4 @@ _weakref_proxy(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=28265e89d583273d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f4be6b8177fbceb8 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_winapi.c.h b/Modules/clinic/_winapi.c.h index c648e68be448c65..ad4dc42ffdece72 100644 --- a/Modules/clinic/_winapi.c.h +++ b/Modules/clinic/_winapi.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head #include "pycore_long.h" // _PyLong_Size_t_Converter() +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_winapi_Overlapped_GetOverlappedResult__doc__, "GetOverlappedResult($self, wait, /)\n" @@ -113,8 +110,6 @@ static PyObject * _winapi_ConnectNamedPipe(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -127,10 +122,6 @@ _winapi_ConnectNamedPipe(PyObject *module, PyObject *const *args, Py_ssize_t nar #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"handle", "overlapped", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -891,8 +882,6 @@ static PyObject * _winapi_LCMapStringEx(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -905,10 +894,6 @@ _winapi_LCMapStringEx(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"locale", "flags", "src", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -949,8 +934,6 @@ static PyObject * _winapi_ReadFile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -963,10 +946,6 @@ _winapi_ReadFile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"handle", "size", "overlapped", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1197,8 +1176,6 @@ static PyObject * _winapi_WriteFile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -1211,10 +1188,6 @@ _winapi_WriteFile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"handle", "buffer", "overlapped", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1269,8 +1242,6 @@ static PyObject * _winapi_GetFileType(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1283,10 +1254,6 @@ _winapi_GetFileType(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"handle", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1331,8 +1298,6 @@ static PyObject * _winapi__mimetypes_read_windows_registry(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1345,10 +1310,6 @@ _winapi__mimetypes_read_windows_registry(PyObject *module, PyObject *const *args #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"on_type_read", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1435,8 +1396,6 @@ static PyObject * _winapi_CopyFile2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -1449,10 +1408,6 @@ _winapi_CopyFile2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"existing_file_name", "new_file_name", "flags", "progress_routine", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1479,4 +1434,4 @@ _winapi_CopyFile2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO return return_value; } -/*[clinic end generated code: output=c7e08927e163ef13 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5bd3cdc6c6c2f54a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_zoneinfo.c.h b/Modules/clinic/_zoneinfo.c.h index ae62865e0f67dff..8b599aa163ad643 100644 --- a/Modules/clinic/_zoneinfo.c.h +++ b/Modules/clinic/_zoneinfo.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(zoneinfo_ZoneInfo_from_file__doc__, "from_file($type, file_obj, /, key=None)\n" @@ -25,8 +22,6 @@ static PyObject * zoneinfo_ZoneInfo_from_file(PyTypeObject *type, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -39,10 +34,6 @@ zoneinfo_ZoneInfo_from_file(PyTypeObject *type, PyTypeObject *cls, PyObject *con #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "key", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -88,8 +79,6 @@ static PyObject * zoneinfo_ZoneInfo_no_cache(PyTypeObject *type, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -102,10 +91,6 @@ zoneinfo_ZoneInfo_no_cache(PyTypeObject *type, PyTypeObject *cls, PyObject *cons #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"key", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -144,8 +129,6 @@ static PyObject * zoneinfo_ZoneInfo_clear_cache(PyTypeObject *type, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -158,10 +141,6 @@ zoneinfo_ZoneInfo_clear_cache(PyTypeObject *type, PyTypeObject *cls, PyObject *c #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"only_keys", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -372,4 +351,4 @@ zoneinfo_ZoneInfo__unpickle(PyTypeObject *type, PyTypeObject *cls, PyObject *con exit: return return_value; } -/*[clinic end generated code: output=54051388dfc408af input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ff82f80918eec07e input=a9049054013a1b77]*/ diff --git a/Modules/clinic/arraymodule.c.h b/Modules/clinic/arraymodule.c.h index 8bdfcc62bef0850..bb8b13b16e5f605 100644 --- a/Modules/clinic/arraymodule.c.h +++ b/Modules/clinic/arraymodule.c.h @@ -2,11 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() PyDoc_STRVAR(array_array___copy____doc__, @@ -675,4 +670,4 @@ PyDoc_STRVAR(array_arrayiterator___setstate____doc__, #define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \ {"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__}, -/*[clinic end generated code: output=ab24c7a40a41c2e1 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d1cfc81785473e3f input=a9049054013a1b77]*/ diff --git a/Modules/clinic/binascii.c.h b/Modules/clinic/binascii.c.h index 8af49b4d87afc24..270292a9ad6ebf4 100644 --- a/Modules/clinic/binascii.c.h +++ b/Modules/clinic/binascii.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(binascii_a2b_uu__doc__, "a2b_uu($module, data, /)\n" @@ -55,8 +52,6 @@ static PyObject * binascii_b2a_uu(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -69,10 +64,6 @@ binascii_b2a_uu(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "backtick", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -135,8 +126,6 @@ static PyObject * binascii_a2b_base64(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -149,10 +138,6 @@ binascii_a2b_base64(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "strict_mode", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -206,8 +191,6 @@ static PyObject * binascii_b2a_base64(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -220,10 +203,6 @@ binascii_b2a_base64(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "newline", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -397,8 +376,6 @@ static PyObject * binascii_b2a_hex(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -411,10 +388,6 @@ binascii_b2a_hex(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"data", "sep", "bytes_per_sep", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -490,8 +463,6 @@ static PyObject * binascii_hexlify(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -504,10 +475,6 @@ binascii_hexlify(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"data", "sep", "bytes_per_sep", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -640,8 +607,6 @@ static PyObject * binascii_a2b_qp(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -654,10 +619,6 @@ binascii_a2b_qp(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"data", "header", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -716,8 +677,6 @@ static PyObject * binascii_b2a_qp(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -730,10 +689,6 @@ binascii_b2a_qp(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"data", "quotetabs", "istext", "header", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -795,4 +750,4 @@ binascii_b2a_qp(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj return return_value; } -/*[clinic end generated code: output=bf950ef45a10928d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=06af290bddcdcb38 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/cmathmodule.c.h b/Modules/clinic/cmathmodule.c.h index 941448e76e80def..dc7f1ac9018304c 100644 --- a/Modules/clinic/cmathmodule.c.h +++ b/Modules/clinic/cmathmodule.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(cmath_acos__doc__, "acos($module, z, /)\n" @@ -899,8 +896,6 @@ static PyObject * cmath_isclose(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -913,10 +908,6 @@ cmath_isclose(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", "rel_tol", "abs_tol", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -982,4 +973,4 @@ cmath_isclose(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec exit: return return_value; } -/*[clinic end generated code: output=87f609786ef270cd input=a9049054013a1b77]*/ +/*[clinic end generated code: output=97f2039871cdba1c input=a9049054013a1b77]*/ diff --git a/Modules/clinic/fcntlmodule.c.h b/Modules/clinic/fcntlmodule.c.h index c15f345ee6ffe8b..8c9a143cc42832c 100644 --- a/Modules/clinic/fcntlmodule.c.h +++ b/Modules/clinic/fcntlmodule.c.h @@ -2,11 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_fileutils.h" // _PyLong_FileDescriptor_Converter() PyDoc_STRVAR(fcntl_fcntl__doc__, @@ -250,4 +245,4 @@ fcntl_lockf(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=5f096e8731fa38be input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a899197278b7794b input=a9049054013a1b77]*/ diff --git a/Modules/clinic/gcmodule.c.h b/Modules/clinic/gcmodule.c.h index 290a8aaa2728e57..5ea20df8ca5cc98 100644 --- a/Modules/clinic/gcmodule.c.h +++ b/Modules/clinic/gcmodule.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _Py_convert_optional_to_ssize_t() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(gc_enable__doc__, "enable($module, /)\n" @@ -95,8 +92,6 @@ static PyObject * gc_collect(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -109,10 +104,6 @@ gc_collect(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"generation", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -272,8 +263,6 @@ static PyObject * gc_get_objects(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -286,10 +275,6 @@ gc_get_objects(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"generation", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -425,4 +410,4 @@ gc_get_freeze_count(PyObject *module, PyObject *Py_UNUSED(ignored)) exit: return return_value; } -/*[clinic end generated code: output=fe89ce0b90a1067d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d457376f89c36c00 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/grpmodule.c.h b/Modules/clinic/grpmodule.c.h index 38de3ce68ceb7f1..296f3aff065ac35 100644 --- a/Modules/clinic/grpmodule.c.h +++ b/Modules/clinic/grpmodule.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(grp_getgrgid__doc__, "getgrgid($module, /, id)\n" "--\n" @@ -26,23 +20,7 @@ static PyObject * grp_getgrgid(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - - #define NUM_KEYWORDS 1 - static struct { - PyGC_Head _this_is_not_used; - PyObject_VAR_HEAD - PyObject *ob_item[NUM_KEYWORDS]; - } _kwtuple = { - .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) - .ob_item = { &_Py_ID(id), }, - }; - #undef NUM_KEYWORDS - #define KWTUPLE (&_kwtuple.ob_base.ob_base) - - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE + #define KWTUPLE NULL static const char * const _keywords[] = {"id", NULL}; static _PyArg_Parser _parser = { @@ -83,23 +61,7 @@ static PyObject * grp_getgrnam(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - - #define NUM_KEYWORDS 1 - static struct { - PyGC_Head _this_is_not_used; - PyObject_VAR_HEAD - PyObject *ob_item[NUM_KEYWORDS]; - } _kwtuple = { - .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) - .ob_item = { &_Py_ID(name), }, - }; - #undef NUM_KEYWORDS - #define KWTUPLE (&_kwtuple.ob_base.ob_base) - - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE + #define KWTUPLE NULL static const char * const _keywords[] = {"name", NULL}; static _PyArg_Parser _parser = { @@ -146,4 +108,4 @@ grp_getgrall(PyObject *module, PyObject *Py_UNUSED(ignored)) { return grp_getgrall_impl(module); } -/*[clinic end generated code: output=e685227ed5d9be9f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b88b2afc5577c816 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/itertoolsmodule.c.h b/Modules/clinic/itertoolsmodule.c.h index 6555bd495b200ee..be2d678cb816795 100644 --- a/Modules/clinic/itertoolsmodule.c.h +++ b/Modules/clinic/itertoolsmodule.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(batched_new__doc__, "batched(iterable, n)\n" @@ -34,8 +31,6 @@ static PyObject * batched_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -48,10 +43,6 @@ batched_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"iterable", "n", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -140,8 +131,6 @@ static PyObject * itertools_groupby(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -154,10 +143,6 @@ itertools_groupby(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"iterable", "key", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -486,8 +471,6 @@ static PyObject * itertools_combinations(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -500,10 +483,6 @@ itertools_combinations(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"iterable", "r", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -557,8 +536,6 @@ static PyObject * itertools_combinations_with_replacement(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -571,10 +548,6 @@ itertools_combinations_with_replacement(PyTypeObject *type, PyObject *args, PyOb #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"iterable", "r", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -627,8 +600,6 @@ static PyObject * itertools_permutations(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -641,10 +612,6 @@ itertools_permutations(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"iterable", "r", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -689,8 +656,6 @@ static PyObject * itertools_accumulate(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -703,10 +668,6 @@ itertools_accumulate(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"iterable", "func", "initial", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -764,8 +725,6 @@ static PyObject * itertools_compress(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -778,10 +737,6 @@ itertools_compress(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"data", "selectors", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -862,8 +817,6 @@ static PyObject * itertools_count(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -876,10 +829,6 @@ itertools_count(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"start", "step", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -914,4 +863,4 @@ itertools_count(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=20999801c7349d2c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ea4a77671628300a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/mathmodule.c.h b/Modules/clinic/mathmodule.c.h index c16c1b083985f2a..4a1391ac36f6ebb 100644 --- a/Modules/clinic/mathmodule.c.h +++ b/Modules/clinic/mathmodule.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(math_ceil__doc__, "ceil($module, x, /)\n" @@ -578,8 +575,6 @@ static PyObject * math_isclose(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -592,10 +587,6 @@ math_isclose(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"a", "b", "rel_tol", "abs_tol", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -696,8 +687,6 @@ static PyObject * math_prod(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -710,10 +699,6 @@ math_prod(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "start", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -846,8 +831,6 @@ static PyObject * math_nextafter(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -860,10 +843,6 @@ math_nextafter(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "", "steps", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -950,4 +929,4 @@ math_ulp(PyObject *module, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=91a0357265a2a553 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9ee3cc016c9e211d input=a9049054013a1b77]*/ diff --git a/Modules/clinic/md5module.c.h b/Modules/clinic/md5module.c.h index b4602104f180429..3195cd7a0decd1c 100644 --- a/Modules/clinic/md5module.c.h +++ b/Modules/clinic/md5module.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(MD5Type_copy__doc__, "copy($self, /)\n" @@ -91,8 +88,6 @@ static PyObject * _md5_md5(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -105,10 +100,6 @@ _md5_md5(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "usedforsecurity", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -148,4 +139,4 @@ _md5_md5(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw exit: return return_value; } -/*[clinic end generated code: output=b4924c9905cc9f34 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ef476bd24a7aa062 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/overlapped.c.h b/Modules/clinic/overlapped.c.h index 100df2062d8efba..903657da55f48ed 100644 --- a/Modules/clinic/overlapped.c.h +++ b/Modules/clinic/overlapped.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head #include "pycore_long.h" // _PyLong_UnsignedLong_Converter() +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_overlapped_CreateIoCompletionPort__doc__, "CreateIoCompletionPort($module, handle, port, key, concurrency, /)\n" @@ -453,8 +450,6 @@ static PyObject * _overlapped_Overlapped(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -467,10 +462,6 @@ _overlapped_Overlapped(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"event", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1263,4 +1254,4 @@ _overlapped_Overlapped_WSARecvFromInto(OverlappedObject *self, PyObject *const * return return_value; } -/*[clinic end generated code: output=994ad727b827ff87 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1d15930bb96af349 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index e80bbff6b5156d9..32d043d25fa7c63 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -2,14 +2,11 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() #include "pycore_fileutils.h" // _PyLong_FileDescriptor_Converter() +#include "pycore_gc.h" // PyGC_Head #include "pycore_long.h" // _PyLong_UnsignedInt_Converter() +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(os_stat__doc__, "stat($module, /, path, *, dir_fd=None, follow_symlinks=True)\n" @@ -46,8 +43,6 @@ static PyObject * os_stat(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -60,10 +55,6 @@ os_stat(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwn #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "dir_fd", "follow_symlinks", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -128,8 +119,6 @@ static PyObject * os_lstat(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -142,10 +131,6 @@ os_lstat(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "dir_fd", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -224,8 +209,6 @@ static PyObject * os_access(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -238,10 +221,6 @@ os_access(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "mode", "dir_fd", "effective_ids", "follow_symlinks", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -384,8 +363,6 @@ static PyObject * os_chdir(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -398,10 +375,6 @@ os_chdir(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -449,8 +422,6 @@ static PyObject * os_fchdir(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -463,10 +434,6 @@ os_fchdir(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"fd", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -532,8 +499,6 @@ static PyObject * os_chmod(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -546,10 +511,6 @@ os_chmod(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "mode", "dir_fd", "follow_symlinks", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -628,8 +589,6 @@ static PyObject * os_fchmod(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -642,10 +601,6 @@ os_fchmod(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"fd", "mode", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -698,8 +653,6 @@ static PyObject * os_lchmod(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -712,10 +665,6 @@ os_lchmod(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "mode", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -774,8 +723,6 @@ static PyObject * os_chflags(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -788,10 +735,6 @@ os_chflags(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "flags", "follow_symlinks", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -857,8 +800,6 @@ static PyObject * os_lchflags(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -871,10 +812,6 @@ os_lchflags(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "flags", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -927,8 +864,6 @@ static PyObject * os_chroot(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -941,10 +876,6 @@ os_chroot(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -991,8 +922,6 @@ static PyObject * os_fsync(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1005,10 +934,6 @@ os_fsync(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"fd", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1074,8 +999,6 @@ static PyObject * os_fdatasync(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1088,10 +1011,6 @@ os_fdatasync(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"fd", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1160,8 +1079,6 @@ static PyObject * os_chown(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -1174,10 +1091,6 @@ os_chown(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "uid", "gid", "dir_fd", "follow_symlinks", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1253,8 +1166,6 @@ static PyObject * os_fchown(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -1267,10 +1178,6 @@ os_fchown(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"fd", "uid", "gid", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1326,8 +1233,6 @@ static PyObject * os_lchown(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -1340,10 +1245,6 @@ os_lchown(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "uid", "gid", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1446,8 +1347,6 @@ static PyObject * os_link(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -1460,10 +1359,6 @@ os_link(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwn #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"src", "dst", "src_dir_fd", "dst_dir_fd", "follow_symlinks", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1553,8 +1448,6 @@ static PyObject * os_listdir(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1567,10 +1460,6 @@ os_listdir(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1670,8 +1559,6 @@ static PyObject * os_listmounts(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1684,10 +1571,6 @@ os_listmounts(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"volume", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1734,8 +1617,6 @@ static PyObject * os__path_isdevdrive(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1748,10 +1629,6 @@ os__path_isdevdrive(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1865,8 +1742,6 @@ static PyObject * os__getvolumepathname(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1879,10 +1754,6 @@ os__getvolumepathname(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1929,8 +1800,6 @@ static PyObject * os__path_splitroot(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1943,10 +1812,6 @@ os__path_splitroot(PyObject *module, PyObject *const *args, Py_ssize_t nargs, Py #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1993,8 +1858,6 @@ static PyObject * os__path_isdir(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -2007,10 +1870,6 @@ os__path_isdir(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2052,8 +1911,6 @@ static PyObject * os__path_isfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -2066,10 +1923,6 @@ os__path_isfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2111,8 +1964,6 @@ static PyObject * os__path_exists(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -2125,10 +1976,6 @@ os__path_exists(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2170,8 +2017,6 @@ static PyObject * os__path_islink(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -2184,10 +2029,6 @@ os__path_islink(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2227,8 +2068,6 @@ static PyObject * os__path_normpath(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -2241,10 +2080,6 @@ os__path_normpath(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2290,8 +2125,6 @@ static PyObject * os_mkdir(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -2304,10 +2137,6 @@ os_mkdir(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "mode", "dir_fd", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2407,8 +2236,6 @@ static PyObject * os_getpriority(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -2421,10 +2248,6 @@ os_getpriority(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"which", "who", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2474,8 +2297,6 @@ static PyObject * os_setpriority(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -2488,10 +2309,6 @@ os_setpriority(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"which", "who", "priority", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2551,8 +2368,6 @@ static PyObject * os_rename(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -2565,10 +2380,6 @@ os_rename(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"src", "dst", "src_dir_fd", "dst_dir_fd", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2642,8 +2453,6 @@ static PyObject * os_replace(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -2656,10 +2465,6 @@ os_replace(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"src", "dst", "src_dir_fd", "dst_dir_fd", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2731,8 +2536,6 @@ static PyObject * os_rmdir(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -2745,10 +2548,6 @@ os_rmdir(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "dir_fd", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2802,8 +2601,6 @@ static PyObject * os_system(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -2816,10 +2613,6 @@ os_system(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"command", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2876,8 +2669,6 @@ static PyObject * os_system(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -2890,10 +2681,6 @@ os_system(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"command", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -2980,8 +2767,6 @@ static PyObject * os_unlink(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -2994,10 +2779,6 @@ os_unlink(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "dir_fd", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -3054,8 +2835,6 @@ static PyObject * os_remove(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -3068,10 +2847,6 @@ os_remove(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "dir_fd", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -3172,8 +2947,6 @@ static PyObject * os_utime(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -3186,10 +2959,6 @@ os_utime(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "times", "ns", "dir_fd", "follow_symlinks", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -3269,8 +3038,6 @@ static PyObject * os__exit(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -3283,10 +3050,6 @@ os__exit(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"status", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -3380,8 +3143,6 @@ static PyObject * os_execve(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -3394,10 +3155,6 @@ os_execve(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "argv", "env", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -3475,8 +3232,6 @@ static PyObject * os_posix_spawn(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 7 static struct { PyGC_Head _this_is_not_used; @@ -3489,10 +3244,6 @@ os_posix_spawn(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "", "", "file_actions", "setpgroup", "resetids", "setsid", "setsigmask", "setsigdef", "scheduler", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -3625,8 +3376,6 @@ static PyObject * os_posix_spawnp(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 7 static struct { PyGC_Head _this_is_not_used; @@ -3639,10 +3388,6 @@ os_posix_spawnp(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "", "", "file_actions", "setpgroup", "resetids", "setsid", "setsigmask", "setsigdef", "scheduler", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -3868,8 +3613,6 @@ static PyObject * os_register_at_fork(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -3882,10 +3625,6 @@ os_register_at_fork(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"before", "after_in_child", "after_in_parent", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -3994,8 +3733,6 @@ static PyObject * os_sched_get_priority_max(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -4008,10 +3745,6 @@ os_sched_get_priority_max(PyObject *module, PyObject *const *args, Py_ssize_t na #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"policy", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -4056,8 +3789,6 @@ static PyObject * os_sched_get_priority_min(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -4070,10 +3801,6 @@ os_sched_get_priority_min(PyObject *module, PyObject *const *args, Py_ssize_t na #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"policy", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -4151,8 +3878,6 @@ static PyObject * os_sched_param(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -4165,10 +3890,6 @@ os_sched_param(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"sched_priority", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -4843,8 +4564,6 @@ static PyObject * os_getpgid(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -4857,10 +4576,6 @@ os_getpgid(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"pid", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -5327,8 +5042,6 @@ static PyObject * os_wait3(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -5341,10 +5054,6 @@ os_wait3(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"options", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -5392,8 +5101,6 @@ static PyObject * os_wait4(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -5406,10 +5113,6 @@ os_wait4(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"pid", "options", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -5599,8 +5302,6 @@ static PyObject * os_pidfd_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -5613,10 +5314,6 @@ os_pidfd_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"pid", "flags", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -5662,8 +5359,6 @@ static PyObject * os_setns(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -5676,10 +5371,6 @@ os_setns(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"fd", "nstype", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -5736,8 +5427,6 @@ static PyObject * os_unshare(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -5750,10 +5439,6 @@ os_unshare(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"flags", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -5804,8 +5489,6 @@ static PyObject * os_readlink(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -5818,10 +5501,6 @@ os_readlink(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "dir_fd", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -5888,8 +5567,6 @@ static PyObject * os_symlink(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -5902,10 +5579,6 @@ os_symlink(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"src", "dst", "target_is_directory", "dir_fd", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -6161,8 +5834,6 @@ static PyObject * os_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -6175,10 +5846,6 @@ os_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwn #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "flags", "mode", "dir_fd", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -6254,8 +5921,6 @@ static PyObject * os_close(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -6268,10 +5933,6 @@ os_close(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"fd", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -6383,8 +6044,6 @@ static PyObject * os_dup2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -6397,10 +6056,6 @@ os_dup2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwn #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"fd", "fd2", "inheritable", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -6844,8 +6499,6 @@ static PyObject * os_sendfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 7 static struct { PyGC_Head _this_is_not_used; @@ -6858,10 +6511,6 @@ os_sendfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"out_fd", "in_fd", "offset", "count", "headers", "trailers", "flags", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -6946,8 +6595,6 @@ static PyObject * os_sendfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 7 static struct { PyGC_Head _this_is_not_used; @@ -6960,10 +6607,6 @@ os_sendfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"out_fd", "in_fd", "offset", "count", "headers", "trailers", "flags", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -7055,8 +6698,6 @@ static PyObject * os_sendfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -7069,10 +6710,6 @@ os_sendfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"out_fd", "in_fd", "offset", "count", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -7183,8 +6820,6 @@ static PyObject * os_fstat(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -7197,10 +6832,6 @@ os_fstat(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"fd", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -7535,8 +7166,6 @@ static PyObject * os_copy_file_range(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -7549,10 +7178,6 @@ os_copy_file_range(PyObject *module, PyObject *const *args, Py_ssize_t nargs, Py #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"src", "dst", "count", "offset_src", "offset_dst", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -7649,8 +7274,6 @@ static PyObject * os_splice(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 6 static struct { PyGC_Head _this_is_not_used; @@ -7663,10 +7286,6 @@ os_splice(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"src", "dst", "count", "offset_src", "offset_dst", "flags", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -7757,8 +7376,6 @@ static PyObject * os_mkfifo(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -7771,10 +7388,6 @@ os_mkfifo(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "mode", "dir_fd", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -7857,8 +7470,6 @@ static PyObject * os_mknod(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -7871,10 +7482,6 @@ os_mknod(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "mode", "device", "dir_fd", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -8112,8 +7719,6 @@ static PyObject * os_truncate(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -8126,10 +7731,6 @@ os_truncate(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "length", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -8504,8 +8105,6 @@ static PyObject * os_WIFCONTINUED(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -8518,10 +8117,6 @@ os_WIFCONTINUED(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"status", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -8571,8 +8166,6 @@ static PyObject * os_WIFSTOPPED(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -8585,10 +8178,6 @@ os_WIFSTOPPED(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"status", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -8638,8 +8227,6 @@ static PyObject * os_WIFSIGNALED(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -8652,10 +8239,6 @@ os_WIFSIGNALED(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"status", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -8705,8 +8288,6 @@ static PyObject * os_WIFEXITED(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -8719,10 +8300,6 @@ os_WIFEXITED(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"status", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -8772,8 +8349,6 @@ static PyObject * os_WEXITSTATUS(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -8786,10 +8361,6 @@ os_WEXITSTATUS(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"status", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -8839,8 +8410,6 @@ static PyObject * os_WTERMSIG(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -8853,10 +8422,6 @@ os_WTERMSIG(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"status", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -8906,8 +8471,6 @@ static PyObject * os_WSTOPSIG(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -8920,10 +8483,6 @@ os_WSTOPSIG(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"status", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -9011,8 +8570,6 @@ static PyObject * os_statvfs(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -9025,10 +8582,6 @@ os_statvfs(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -9075,8 +8628,6 @@ static PyObject * os__getdiskusage(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -9089,10 +8640,6 @@ os__getdiskusage(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -9188,8 +8735,6 @@ static PyObject * os_pathconf(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -9202,10 +8747,6 @@ os_pathconf(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "name", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -9377,8 +8918,6 @@ static PyObject * os_startfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -9391,10 +8930,6 @@ os_startfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"filepath", "operation", "arguments", "cwd", "show_cmd", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -9521,8 +9056,6 @@ static PyObject * os_device_encoding(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -9535,10 +9068,6 @@ os_device_encoding(PyObject *module, PyObject *const *args, Py_ssize_t nargs, Py #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"fd", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -9715,8 +9244,6 @@ static PyObject * os_getxattr(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -9729,10 +9256,6 @@ os_getxattr(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "attribute", "follow_symlinks", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -9802,8 +9325,6 @@ static PyObject * os_setxattr(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -9816,10 +9337,6 @@ os_setxattr(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "attribute", "value", "flags", "follow_symlinks", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -9914,8 +9431,6 @@ static PyObject * os_removexattr(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -9928,10 +9443,6 @@ os_removexattr(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "attribute", "follow_symlinks", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -10000,8 +9511,6 @@ static PyObject * os_listxattr(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -10014,10 +9523,6 @@ os_listxattr(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", "follow_symlinks", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -10118,8 +9623,6 @@ static PyObject * os_memfd_create(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -10132,10 +9635,6 @@ os_memfd_create(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"name", "flags", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -10192,8 +9691,6 @@ static PyObject * os_eventfd(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -10206,10 +9703,6 @@ os_eventfd(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"initval", "flags", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -10263,8 +9756,6 @@ static PyObject * os_eventfd_read(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -10277,10 +9768,6 @@ os_eventfd_read(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"fd", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -10324,8 +9811,6 @@ static PyObject * os_eventfd_write(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -10338,10 +9823,6 @@ os_eventfd_write(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"fd", "value", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -10738,8 +10219,6 @@ static PyObject * os_DirEntry_stat(DirEntry *self, PyTypeObject *defining_class, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -10752,10 +10231,6 @@ os_DirEntry_stat(DirEntry *self, PyTypeObject *defining_class, PyObject *const * #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"follow_symlinks", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -10802,8 +10277,6 @@ static PyObject * os_DirEntry_is_dir(DirEntry *self, PyTypeObject *defining_class, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -10816,10 +10289,6 @@ os_DirEntry_is_dir(DirEntry *self, PyTypeObject *defining_class, PyObject *const #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"follow_symlinks", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -10871,8 +10340,6 @@ static PyObject * os_DirEntry_is_file(DirEntry *self, PyTypeObject *defining_class, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -10885,10 +10352,6 @@ os_DirEntry_is_file(DirEntry *self, PyTypeObject *defining_class, PyObject *cons #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"follow_symlinks", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -10981,8 +10444,6 @@ static PyObject * os_scandir(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -10995,10 +10456,6 @@ os_scandir(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -11050,8 +10507,6 @@ static PyObject * os_fspath(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -11064,10 +10519,6 @@ os_fspath(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -11107,8 +10558,6 @@ static PyObject * os_getrandom(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -11121,10 +10570,6 @@ os_getrandom(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"size", "flags", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -11194,8 +10639,6 @@ static PyObject * os__add_dll_directory(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -11208,10 +10651,6 @@ os__add_dll_directory(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -11262,8 +10701,6 @@ static PyObject * os__remove_dll_directory(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -11276,10 +10713,6 @@ os__remove_dll_directory(PyObject *module, PyObject *const *args, Py_ssize_t nar #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"cookie", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -11333,8 +10766,6 @@ static PyObject * os_waitstatus_to_exitcode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -11347,10 +10778,6 @@ os_waitstatus_to_exitcode(PyObject *module, PyObject *const *args, Py_ssize_t na #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"status", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -11993,4 +11420,4 @@ os_waitstatus_to_exitcode(PyObject *module, PyObject *const *args, Py_ssize_t na #ifndef OS_WAITSTATUS_TO_EXITCODE_METHODDEF #define OS_WAITSTATUS_TO_EXITCODE_METHODDEF #endif /* !defined(OS_WAITSTATUS_TO_EXITCODE_METHODDEF) */ -/*[clinic end generated code: output=1b34619e5f65adc2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=82e9d980c1f55c62 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/pwdmodule.c.h b/Modules/clinic/pwdmodule.c.h index 748c873b1c8a457..0e8aa5e6a9f470e 100644 --- a/Modules/clinic/pwdmodule.c.h +++ b/Modules/clinic/pwdmodule.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(pwd_getpwuid__doc__, "getpwuid($module, uidobj, /)\n" "--\n" @@ -77,4 +71,4 @@ pwd_getpwall(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef PWD_GETPWALL_METHODDEF #define PWD_GETPWALL_METHODDEF #endif /* !defined(PWD_GETPWALL_METHODDEF) */ -/*[clinic end generated code: output=1edf1e26cd2762db input=a9049054013a1b77]*/ +/*[clinic end generated code: output=211c7a2516899b91 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/pyexpat.c.h b/Modules/clinic/pyexpat.c.h index 97247781eaa0724..257294373e1a009 100644 --- a/Modules/clinic/pyexpat.c.h +++ b/Modules/clinic/pyexpat.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(pyexpat_xmlparser_Parse__doc__, "Parse($self, data, isfinal=False, /)\n" @@ -375,8 +372,6 @@ static PyObject * pyexpat_ParserCreate(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -389,10 +384,6 @@ pyexpat_ParserCreate(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"encoding", "namespace_separator", "intern", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -498,4 +489,4 @@ pyexpat_ErrorString(PyObject *module, PyObject *arg) #ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */ -/*[clinic end generated code: output=6b30852bfc778208 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=408d42582229fc8c input=a9049054013a1b77]*/ diff --git a/Modules/clinic/readline.c.h b/Modules/clinic/readline.c.h index 0bd6e36851e45df..e5a784a5f79e5af 100644 --- a/Modules/clinic/readline.c.h +++ b/Modules/clinic/readline.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(readline_parse_and_bind__doc__, "parse_and_bind($module, string, /)\n" "--\n" @@ -688,4 +682,4 @@ readline_redisplay(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef READLINE_CLEAR_HISTORY_METHODDEF #define READLINE_CLEAR_HISTORY_METHODDEF #endif /* !defined(READLINE_CLEAR_HISTORY_METHODDEF) */ -/*[clinic end generated code: output=2c9c5709b3e00c8b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=790ed2ba01babb60 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/resource.c.h b/Modules/clinic/resource.c.h index d769a7f612357d3..0ac272af25d1545 100644 --- a/Modules/clinic/resource.c.h +++ b/Modules/clinic/resource.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - #if defined(HAVE_GETRUSAGE) PyDoc_STRVAR(resource_getrusage__doc__, @@ -178,4 +172,4 @@ resource_getpagesize(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef RESOURCE_PRLIMIT_METHODDEF #define RESOURCE_PRLIMIT_METHODDEF #endif /* !defined(RESOURCE_PRLIMIT_METHODDEF) */ -/*[clinic end generated code: output=916ecf0eb1927c37 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2376b9a3f03777aa input=a9049054013a1b77]*/ diff --git a/Modules/clinic/selectmodule.c.h b/Modules/clinic/selectmodule.c.h index 69c0f06789e714b..5113ffa41ff8838 100644 --- a/Modules/clinic/selectmodule.c.h +++ b/Modules/clinic/selectmodule.c.h @@ -2,13 +2,10 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_fileutils.h" // _PyLong_FileDescriptor_Converter() +#include "pycore_gc.h" // PyGC_Head #include "pycore_long.h" // _PyLong_UnsignedShort_Converter() +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(select_select__doc__, "select($module, rlist, wlist, xlist, timeout=None, /)\n" @@ -530,8 +527,6 @@ static PyObject * select_epoll(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -544,10 +539,6 @@ select_epoll(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"sizehint", "flags", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -696,8 +687,6 @@ static PyObject * select_epoll_register(pyEpoll_Object *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -710,10 +699,6 @@ select_epoll_register(pyEpoll_Object *self, PyObject *const *args, Py_ssize_t na #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"fd", "eventmask", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -773,8 +758,6 @@ static PyObject * select_epoll_modify(pyEpoll_Object *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -787,10 +770,6 @@ select_epoll_modify(pyEpoll_Object *self, PyObject *const *args, Py_ssize_t narg #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"fd", "eventmask", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -842,8 +821,6 @@ static PyObject * select_epoll_unregister(pyEpoll_Object *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -856,10 +833,6 @@ select_epoll_unregister(pyEpoll_Object *self, PyObject *const *args, Py_ssize_t #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"fd", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -913,8 +886,6 @@ static PyObject * select_epoll_poll(pyEpoll_Object *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -927,10 +898,6 @@ select_epoll_poll(pyEpoll_Object *self, PyObject *const *args, Py_ssize_t nargs, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"timeout", "maxevents", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1311,4 +1278,4 @@ select_kqueue_control(kqueue_queue_Object *self, PyObject *const *args, Py_ssize #ifndef SELECT_KQUEUE_CONTROL_METHODDEF #define SELECT_KQUEUE_CONTROL_METHODDEF #endif /* !defined(SELECT_KQUEUE_CONTROL_METHODDEF) */ -/*[clinic end generated code: output=a215af2157f038c7 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=055dddfe10e86967 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha1module.c.h b/Modules/clinic/sha1module.c.h index ad15ddaadfc86cf..6f2d22e313d1d0b 100644 --- a/Modules/clinic/sha1module.c.h +++ b/Modules/clinic/sha1module.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(SHA1Type_copy__doc__, "copy($self, /)\n" @@ -91,8 +88,6 @@ static PyObject * _sha1_sha1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -105,10 +100,6 @@ _sha1_sha1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "usedforsecurity", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -148,4 +139,4 @@ _sha1_sha1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * exit: return return_value; } -/*[clinic end generated code: output=4d1293ca3472acdb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5d50f574050bc588 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha2module.c.h b/Modules/clinic/sha2module.c.h index 8f855ca345e47ab..d3bbd3bb3110652 100644 --- a/Modules/clinic/sha2module.c.h +++ b/Modules/clinic/sha2module.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(SHA256Type_copy__doc__, "copy($self, /)\n" @@ -158,8 +155,6 @@ static PyObject * _sha2_sha256(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -172,10 +167,6 @@ _sha2_sha256(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "usedforsecurity", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -232,8 +223,6 @@ static PyObject * _sha2_sha224(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -246,10 +235,6 @@ _sha2_sha224(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "usedforsecurity", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -306,8 +291,6 @@ static PyObject * _sha2_sha512(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -320,10 +303,6 @@ _sha2_sha512(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "usedforsecurity", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -380,8 +359,6 @@ static PyObject * _sha2_sha384(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -394,10 +371,6 @@ _sha2_sha384(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"string", "usedforsecurity", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -437,4 +410,4 @@ _sha2_sha384(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject exit: return return_value; } -/*[clinic end generated code: output=f81dacb48f3fee72 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7f1564d2375cb25a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha3module.c.h b/Modules/clinic/sha3module.c.h index 80fe3ed32c80dc8..72fef9377b33758 100644 --- a/Modules/clinic/sha3module.c.h +++ b/Modules/clinic/sha3module.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head #include "pycore_long.h" // _PyLong_UnsignedLong_Converter() +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(py_sha3_new__doc__, "sha3_224(data=b\'\', /, *, usedforsecurity=True)\n" @@ -22,8 +19,6 @@ static PyObject * py_sha3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -36,10 +31,6 @@ py_sha3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "usedforsecurity", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -194,4 +185,4 @@ _sha3_shake_128_hexdigest(SHA3object *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=5188d9ae4af48c6d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0db9257cbfc880a4 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/signalmodule.c.h b/Modules/clinic/signalmodule.c.h index f0ae699a3f1e188..5e8957a4be780d4 100644 --- a/Modules/clinic/signalmodule.c.h +++ b/Modules/clinic/signalmodule.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(signal_default_int_handler__doc__, "default_int_handler($module, signalnum, frame, /)\n" "--\n" @@ -705,4 +699,4 @@ signal_pidfd_send_signal(PyObject *module, PyObject *const *args, Py_ssize_t nar #ifndef SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF #define SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF #endif /* !defined(SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF) */ -/*[clinic end generated code: output=9903be3eba6cbc1c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ef4c2ad1a2443063 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/socketmodule.c.h b/Modules/clinic/socketmodule.c.h index 5e2f581c3e06006..7276fa02fc13878 100644 --- a/Modules/clinic/socketmodule.c.h +++ b/Modules/clinic/socketmodule.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() static int sock_initobj_impl(PySocketSockObject *self, int family, int type, int proto, @@ -16,8 +13,6 @@ static int sock_initobj(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -30,10 +25,6 @@ sock_initobj(PyObject *self, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"family", "type", "proto", "fileno", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -91,4 +82,4 @@ sock_initobj(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=c44e3ac23999ac60 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a25618baf174cee5 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/symtablemodule.c.h b/Modules/clinic/symtablemodule.c.h index 04fdb9f2d9b7760..2cd08f81782007c 100644 --- a/Modules/clinic/symtablemodule.c.h +++ b/Modules/clinic/symtablemodule.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_symtable_symtable__doc__, "symtable($module, source, filename, startstr, /)\n" "--\n" @@ -54,4 +48,4 @@ _symtable_symtable(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=07716ddbd6c7efe1 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3f7ccf535d750238 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/syslogmodule.c.h b/Modules/clinic/syslogmodule.c.h index 3e0792b88060c02..32f22b1d1a2e72a 100644 --- a/Modules/clinic/syslogmodule.c.h +++ b/Modules/clinic/syslogmodule.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(syslog_openlog__doc__, "openlog($module, /, ident=, logoption=0,\n" " facility=LOG_USER)\n" @@ -26,23 +20,7 @@ static PyObject * syslog_openlog(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - - #define NUM_KEYWORDS 3 - static struct { - PyGC_Head _this_is_not_used; - PyObject_VAR_HEAD - PyObject *ob_item[NUM_KEYWORDS]; - } _kwtuple = { - .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) - .ob_item = { &_Py_ID(ident), &_Py_ID(logoption), &_Py_ID(facility), }, - }; - #undef NUM_KEYWORDS - #define KWTUPLE (&_kwtuple.ob_base.ob_base) - - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE + #define KWTUPLE NULL static const char * const _keywords[] = {"ident", "logoption", "facility", NULL}; static _PyArg_Parser _parser = { @@ -251,4 +229,4 @@ syslog_LOG_UPTO(PyObject *module, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=b8124c0977ed6177 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ce81f488ab484888 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/termios.c.h b/Modules/clinic/termios.c.h index 44d4107c378e537..42a90e0f6f39441 100644 --- a/Modules/clinic/termios.c.h +++ b/Modules/clinic/termios.c.h @@ -2,11 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_fileutils.h" // _PyLong_FileDescriptor_Converter() PyDoc_STRVAR(termios_tcgetattr__doc__, @@ -293,4 +288,4 @@ termios_tcsetwinsize(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=434df4394b596e92 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=623285f7b7386d9e input=a9049054013a1b77]*/ diff --git a/Modules/clinic/unicodedata.c.h b/Modules/clinic/unicodedata.c.h index ec30f9017e3702a..74362c6a6857b74 100644 --- a/Modules/clinic/unicodedata.c.h +++ b/Modules/clinic/unicodedata.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(unicodedata_UCD_decimal__doc__, "decimal($self, chr, default=, /)\n" "--\n" @@ -523,4 +517,4 @@ unicodedata_UCD_lookup(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=43e551ecaa985a40 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ca10ded25747d182 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/zlibmodule.c.h b/Modules/clinic/zlibmodule.c.h index 1debe2ae98959d5..b55d88fdc59d84a 100644 --- a/Modules/clinic/zlibmodule.c.h +++ b/Modules/clinic/zlibmodule.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(zlib_compress__doc__, "compress($module, data, /, level=Z_DEFAULT_COMPRESSION, wbits=MAX_WBITS)\n" @@ -32,8 +29,6 @@ static PyObject * zlib_compress(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -46,10 +41,6 @@ zlib_compress(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "level", "wbits", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -126,8 +117,6 @@ static PyObject * zlib_decompress(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -140,10 +129,6 @@ zlib_decompress(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "wbits", "bufsize", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -245,8 +230,6 @@ static PyObject * zlib_compressobj(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 6 static struct { PyGC_Head _this_is_not_used; @@ -259,10 +242,6 @@ zlib_compressobj(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"level", "method", "wbits", "memLevel", "strategy", "zdict", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -372,8 +351,6 @@ static PyObject * zlib_decompressobj(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -386,10 +363,6 @@ zlib_decompressobj(PyObject *module, PyObject *const *args, Py_ssize_t nargs, Py #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"wbits", "zdict", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -516,8 +489,6 @@ static PyObject * zlib_Decompress_decompress(compobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -530,10 +501,6 @@ zlib_Decompress_decompress(compobject *self, PyTypeObject *cls, PyObject *const #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "max_length", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -928,8 +895,6 @@ static PyObject * zlib_ZlibDecompressor_decompress(ZlibDecompressor *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -942,10 +907,6 @@ zlib_ZlibDecompressor_decompress(ZlibDecompressor *self, PyObject *const *args, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"data", "max_length", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1130,4 +1091,4 @@ zlib_crc32(PyObject *module, PyObject *const *args, Py_ssize_t nargs) #ifndef ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF #define ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF #endif /* !defined(ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF) */ -/*[clinic end generated code: output=d574a79aa47c9969 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=45e80a64f3567aa8 input=a9049054013a1b77]*/ diff --git a/Modules/grpmodule.c b/Modules/grpmodule.c index f5709296334a8fa..ba13ea021a9ac85 100644 --- a/Modules/grpmodule.c +++ b/Modules/grpmodule.c @@ -1,6 +1,9 @@ /* UNIX group file access module */ +// Argument Clinic avoids the internal C API +#define Py_ARGUMENT_CLINIC_AVOID_INTERNAL_CAPI + #include "Python.h" #include "posixmodule.h" diff --git a/Modules/syslogmodule.c b/Modules/syslogmodule.c index 6db8de9c491dd91..85a638db1191fad 100644 --- a/Modules/syslogmodule.c +++ b/Modules/syslogmodule.c @@ -49,6 +49,9 @@ Revision history: /* syslog module */ +// Argument Clinic avoids the internal C API +#define Py_ARGUMENT_CLINIC_AVOID_INTERNAL_CAPI + #include "Python.h" #include "osdefs.h" // SEP diff --git a/Objects/clinic/bytearrayobject.c.h b/Objects/clinic/bytearrayobject.c.h index f091fc7afbd693b..5a430f5522aed9d 100644 --- a/Objects/clinic/bytearrayobject.c.h +++ b/Objects/clinic/bytearrayobject.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() static int bytearray___init___impl(PyByteArrayObject *self, PyObject *arg, @@ -17,8 +14,6 @@ static int bytearray___init__(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -31,10 +26,6 @@ bytearray___init__(PyObject *self, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"source", "encoding", "errors", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -240,8 +231,6 @@ static PyObject * bytearray_translate(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -254,10 +243,6 @@ bytearray_translate(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t n #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "delete", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -443,8 +428,6 @@ static PyObject * bytearray_split(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -457,10 +440,6 @@ bytearray_split(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t nargs #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"sep", "maxsplit", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -565,8 +544,6 @@ static PyObject * bytearray_rsplit(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -579,10 +556,6 @@ bytearray_rsplit(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t narg #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"sep", "maxsplit", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -942,8 +915,6 @@ static PyObject * bytearray_decode(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -956,10 +927,6 @@ bytearray_decode(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t narg #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"encoding", "errors", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1049,8 +1016,6 @@ static PyObject * bytearray_splitlines(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1063,10 +1028,6 @@ bytearray_splitlines(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"keepends", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1161,8 +1122,6 @@ static PyObject * bytearray_hex(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -1175,10 +1134,6 @@ bytearray_hex(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t nargs, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"sep", "bytes_per_sep", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1285,4 +1240,4 @@ bytearray_sizeof(PyByteArrayObject *self, PyObject *Py_UNUSED(ignored)) { return bytearray_sizeof_impl(self); } -/*[clinic end generated code: output=d388e9027b333f00 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a9e1d872eb9b2565 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/bytesobject.c.h b/Objects/clinic/bytesobject.c.h index 66db76dbbb4faf4..fbd813e095553d6 100644 --- a/Objects/clinic/bytesobject.c.h +++ b/Objects/clinic/bytesobject.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(bytes___bytes____doc__, "__bytes__($self, /)\n" @@ -51,8 +48,6 @@ static PyObject * bytes_split(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -65,10 +60,6 @@ bytes_split(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"sep", "maxsplit", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -225,8 +216,6 @@ static PyObject * bytes_rsplit(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -239,10 +228,6 @@ bytes_rsplit(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, PyObj #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"sep", "maxsplit", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -427,8 +412,6 @@ static PyObject * bytes_translate(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -441,10 +424,6 @@ bytes_translate(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, Py #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "delete", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -710,8 +689,6 @@ static PyObject * bytes_decode(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -724,10 +701,6 @@ bytes_decode(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, PyObj #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"encoding", "errors", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -804,8 +777,6 @@ static PyObject * bytes_splitlines(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -818,10 +789,6 @@ bytes_splitlines(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, P #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"keepends", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -916,8 +883,6 @@ static PyObject * bytes_hex(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -930,10 +895,6 @@ bytes_hex(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"sep", "bytes_per_sep", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -978,8 +939,6 @@ static PyObject * bytes_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -992,10 +951,6 @@ bytes_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"source", "encoding", "errors", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1061,4 +1016,4 @@ bytes_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=9da56b6c04914e18 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c50e3728c857942e input=a9049054013a1b77]*/ diff --git a/Objects/clinic/classobject.c.h b/Objects/clinic/classobject.c.h index a7bac63052bc408..48cfd6c7b78ca32 100644 --- a/Objects/clinic/classobject.c.h +++ b/Objects/clinic/classobject.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(method___reduce____doc__, "__reduce__($self, /)\n" "--\n" @@ -86,4 +80,4 @@ instancemethod_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=2a5e7fa5947a86cb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a0d17bad3b0734d9 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/codeobject.c.h b/Objects/clinic/codeobject.c.h index 65801bd35156a66..892356c1c274545 100644 --- a/Objects/clinic/codeobject.c.h +++ b/Objects/clinic/codeobject.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(code_new__doc__, "code(argcount, posonlyargcount, kwonlyargcount, nlocals, stacksize,\n" @@ -177,8 +174,6 @@ static PyObject * code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 18 static struct { PyGC_Head _this_is_not_used; @@ -191,10 +186,6 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"co_argcount", "co_posonlyargcount", "co_kwonlyargcount", "co_nlocals", "co_stacksize", "co_flags", "co_firstlineno", "co_code", "co_consts", "co_names", "co_varnames", "co_freevars", "co_cellvars", "co_filename", "co_name", "co_qualname", "co_linetable", "co_exceptiontable", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -423,8 +414,6 @@ static PyObject * code__varname_from_oparg(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -437,10 +426,6 @@ code__varname_from_oparg(PyCodeObject *self, PyObject *const *args, Py_ssize_t n #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"oparg", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -464,4 +449,4 @@ code__varname_from_oparg(PyCodeObject *self, PyObject *const *args, Py_ssize_t n exit: return return_value; } -/*[clinic end generated code: output=0446968a1fbd13b2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c9ea84ff26a5e251 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/complexobject.c.h b/Objects/clinic/complexobject.c.h index bb2b3815415f850..b5a5b1e54cc8fa7 100644 --- a/Objects/clinic/complexobject.c.h +++ b/Objects/clinic/complexobject.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(complex_conjugate__doc__, "conjugate($self, /)\n" @@ -105,8 +102,6 @@ static PyObject * complex_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -119,10 +114,6 @@ complex_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"real", "imag", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -157,4 +148,4 @@ complex_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=d438b7ed87f8459e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d1f2f0d6c989a359 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/descrobject.c.h b/Objects/clinic/descrobject.c.h index 75706437df83f96..f88c7b3549738aa 100644 --- a/Objects/clinic/descrobject.c.h +++ b/Objects/clinic/descrobject.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() static PyObject * mappingproxy_new_impl(PyTypeObject *type, PyObject *mapping); @@ -15,8 +12,6 @@ static PyObject * mappingproxy_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -29,10 +24,6 @@ mappingproxy_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"mapping", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -101,8 +92,6 @@ static int property_init(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -115,10 +104,6 @@ property_init(PyObject *self, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"fget", "fset", "fdel", "doc", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -167,4 +152,4 @@ property_init(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=8dc1ddfcf764ac8e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3a7e05c7a52efa66 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/dictobject.c.h b/Objects/clinic/dictobject.c.h index bc2452330e4e2f4..eda86c31fcc5787 100644 --- a/Objects/clinic/dictobject.c.h +++ b/Objects/clinic/dictobject.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(dict_fromkeys__doc__, "fromkeys($type, iterable, value=None, /)\n" "--\n" @@ -197,4 +191,4 @@ dict___reversed__(PyDictObject *self, PyObject *Py_UNUSED(ignored)) { return dict___reversed___impl(self); } -/*[clinic end generated code: output=c0064abbea6091c5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=582766ac0154c8bf input=a9049054013a1b77]*/ diff --git a/Objects/clinic/enumobject.c.h b/Objects/clinic/enumobject.c.h index adf78efd0d66f4f..0bdad527abf32cb 100644 --- a/Objects/clinic/enumobject.c.h +++ b/Objects/clinic/enumobject.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(enum_new__doc__, "enumerate(iterable, start=0)\n" @@ -30,8 +27,6 @@ static PyObject * enum_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -44,10 +39,6 @@ enum_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"iterable", "start", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -107,4 +98,4 @@ reversed_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=aba0ddbeab1601e3 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b676b6d9645b2cc5 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/floatobject.c.h b/Objects/clinic/floatobject.c.h index 3d9cd3a683ff5fb..c40eff85cf35529 100644 --- a/Objects/clinic/floatobject.c.h +++ b/Objects/clinic/floatobject.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(float_is_integer__doc__, "is_integer($self, /)\n" "--\n" @@ -322,4 +316,4 @@ float___format__(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=355c3f5102034a41 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=eb093cc601cc5426 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/funcobject.c.h b/Objects/clinic/funcobject.c.h index c3a3a8edc392784..c18aa33cee98440 100644 --- a/Objects/clinic/funcobject.c.h +++ b/Objects/clinic/funcobject.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(func_new__doc__, "function(code, globals, name=None, argdefs=None, closure=None)\n" @@ -33,8 +30,6 @@ static PyObject * func_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -47,10 +42,6 @@ func_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"code", "globals", "name", "argdefs", "closure", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -104,4 +95,4 @@ func_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=777cead7b1f6fad3 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ce9727512de9b334 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/listobject.c.h b/Objects/clinic/listobject.c.h index a41ed3e4b040d94..7890e8470bdcb70 100644 --- a/Objects/clinic/listobject.c.h +++ b/Objects/clinic/listobject.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(list_insert__doc__, "insert($self, index, object, /)\n" @@ -173,8 +170,6 @@ static PyObject * list_sort(PyListObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -187,10 +182,6 @@ list_sort(PyListObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"key", "reverse", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -384,4 +375,4 @@ list___reversed__(PyListObject *self, PyObject *Py_UNUSED(ignored)) { return list___reversed___impl(self); } -/*[clinic end generated code: output=537a17b562c57505 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1e117b9998bb83aa input=a9049054013a1b77]*/ diff --git a/Objects/clinic/longobject.c.h b/Objects/clinic/longobject.c.h index 3ecef1f0fd54d49..3fc3d56b1ae4c57 100644 --- a/Objects/clinic/longobject.c.h +++ b/Objects/clinic/longobject.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() static PyObject * long_new_impl(PyTypeObject *type, PyObject *x, PyObject *obase); @@ -16,8 +13,6 @@ static PyObject * long_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -30,10 +25,6 @@ long_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "base", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -284,8 +275,6 @@ static PyObject * int_to_bytes(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -298,10 +287,6 @@ int_to_bytes(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject * #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"length", "byteorder", "signed", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -395,8 +380,6 @@ static PyObject * int_from_bytes(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -409,10 +392,6 @@ int_from_bytes(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs, PyOb #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"bytes", "byteorder", "signed", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -476,4 +455,4 @@ int_is_integer(PyObject *self, PyObject *Py_UNUSED(ignored)) { return int_is_integer_impl(self); } -/*[clinic end generated code: output=ea9c87ea532dadbe input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ac13f5764574ff42 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/memoryobject.c.h b/Objects/clinic/memoryobject.c.h index a6561e2e54df805..4fabd7f96bd696b 100644 --- a/Objects/clinic/memoryobject.c.h +++ b/Objects/clinic/memoryobject.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(memoryview__doc__, "memoryview(object)\n" @@ -21,8 +18,6 @@ static PyObject * memoryview(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -35,10 +30,6 @@ memoryview(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"object", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -78,8 +69,6 @@ static PyObject * memoryview__from_flags(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -92,10 +81,6 @@ memoryview__from_flags(PyTypeObject *type, PyObject *const *args, Py_ssize_t nar #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"object", "flags", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -157,8 +142,6 @@ static PyObject * memoryview_cast(PyMemoryViewObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -171,10 +154,6 @@ memoryview_cast(PyMemoryViewObject *self, PyObject *const *args, Py_ssize_t narg #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"format", "shape", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -265,8 +244,6 @@ static PyObject * memoryview_tobytes(PyMemoryViewObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -279,10 +256,6 @@ memoryview_tobytes(PyMemoryViewObject *self, PyObject *const *args, Py_ssize_t n #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"order", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -360,8 +333,6 @@ static PyObject * memoryview_hex(PyMemoryViewObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -374,10 +345,6 @@ memoryview_hex(PyMemoryViewObject *self, PyObject *const *args, Py_ssize_t nargs #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"sep", "bytes_per_sep", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -413,4 +380,4 @@ memoryview_hex(PyMemoryViewObject *self, PyObject *const *args, Py_ssize_t nargs exit: return return_value; } -/*[clinic end generated code: output=28a632db32b44b63 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=66bef467834d161c input=a9049054013a1b77]*/ diff --git a/Objects/clinic/moduleobject.c.h b/Objects/clinic/moduleobject.c.h index 29df38885319338..696f6210b80f978 100644 --- a/Objects/clinic/moduleobject.c.h +++ b/Objects/clinic/moduleobject.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(module___init____doc__, "module(name, doc=None)\n" @@ -23,8 +20,6 @@ static int module___init__(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -37,10 +32,6 @@ module___init__(PyObject *self, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"name", "doc", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -74,4 +65,4 @@ module___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=a5a750cc8190576e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=89c3c195c9e4ef6c input=a9049054013a1b77]*/ diff --git a/Objects/clinic/odictobject.c.h b/Objects/clinic/odictobject.c.h index 115a134e3f7f542..909b42a803a0c43 100644 --- a/Objects/clinic/odictobject.c.h +++ b/Objects/clinic/odictobject.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(OrderedDict_fromkeys__doc__, "fromkeys($type, /, iterable, value=None)\n" @@ -24,8 +21,6 @@ static PyObject * OrderedDict_fromkeys(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -38,10 +33,6 @@ OrderedDict_fromkeys(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"iterable", "value", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -89,8 +80,6 @@ static PyObject * OrderedDict_setdefault(PyODictObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -103,10 +92,6 @@ OrderedDict_setdefault(PyODictObject *self, PyObject *const *args, Py_ssize_t na #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"key", "default", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -155,8 +140,6 @@ static PyObject * OrderedDict_pop(PyODictObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -169,10 +152,6 @@ OrderedDict_pop(PyODictObject *self, PyObject *const *args, Py_ssize_t nargs, Py #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"key", "default", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -219,8 +198,6 @@ static PyObject * OrderedDict_popitem(PyODictObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -233,10 +210,6 @@ OrderedDict_popitem(PyODictObject *self, PyObject *const *args, Py_ssize_t nargs #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"last", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -284,8 +257,6 @@ static PyObject * OrderedDict_move_to_end(PyODictObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -298,10 +269,6 @@ OrderedDict_move_to_end(PyODictObject *self, PyObject *const *args, Py_ssize_t n #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"key", "last", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -332,4 +299,4 @@ OrderedDict_move_to_end(PyODictObject *self, PyObject *const *args, Py_ssize_t n exit: return return_value; } -/*[clinic end generated code: output=76d85a9162d62ca8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4b2d092e3fcae79c input=a9049054013a1b77]*/ diff --git a/Objects/clinic/structseq.c.h b/Objects/clinic/structseq.c.h index 40ba18a544f4b36..86a623e00e8b3aa 100644 --- a/Objects/clinic/structseq.c.h +++ b/Objects/clinic/structseq.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() static PyObject * structseq_new_impl(PyTypeObject *type, PyObject *arg, PyObject *dict); @@ -15,8 +12,6 @@ static PyObject * structseq_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -29,10 +24,6 @@ structseq_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"sequence", "dict", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -62,4 +53,4 @@ structseq_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=802d5663c7d01024 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ccded931e1c33467 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/tupleobject.c.h b/Objects/clinic/tupleobject.c.h index 3de95759a13f216..f21712746a5ad12 100644 --- a/Objects/clinic/tupleobject.c.h +++ b/Objects/clinic/tupleobject.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(tuple_index__doc__, "index($self, value, start=0, stop=sys.maxsize, /)\n" "--\n" @@ -118,4 +112,4 @@ tuple___getnewargs__(PyTupleObject *self, PyObject *Py_UNUSED(ignored)) { return tuple___getnewargs___impl(self); } -/*[clinic end generated code: output=48a9e0834b300ac3 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7c5d9d12e0cf6a83 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/typeobject.c.h b/Objects/clinic/typeobject.c.h index 1857eab17a793b4..eb0b22a943ae8f4 100644 --- a/Objects/clinic/typeobject.c.h +++ b/Objects/clinic/typeobject.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(type___instancecheck____doc__, "__instancecheck__($self, instance, /)\n" "--\n" @@ -266,4 +260,4 @@ object___dir__(PyObject *self, PyObject *Py_UNUSED(ignored)) { return object___dir___impl(self); } -/*[clinic end generated code: output=baf5ec2093815a3f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=943f639f264362d9 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/typevarobject.c.h b/Objects/clinic/typevarobject.c.h index 5d12be5361cd2fc..933e5c18966fbd8 100644 --- a/Objects/clinic/typevarobject.c.h +++ b/Objects/clinic/typevarobject.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(typevar_new__doc__, "typevar(name, *constraints, *, bound=None, covariant=False,\n" @@ -24,8 +21,6 @@ static PyObject * typevar_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -38,10 +33,6 @@ typevar_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"name", "bound", "covariant", "contravariant", "infer_variance", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -147,8 +138,6 @@ static PyObject * paramspecargs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -161,10 +150,6 @@ paramspecargs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"origin", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -201,8 +186,6 @@ static PyObject * paramspeckwargs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -215,10 +198,6 @@ paramspeckwargs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"origin", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -257,8 +236,6 @@ static PyObject * paramspec_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -271,10 +248,6 @@ paramspec_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"name", "bound", "covariant", "contravariant", "infer_variance", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -407,8 +380,6 @@ static PyObject * typevartuple(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -421,10 +392,6 @@ typevartuple(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"name", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -538,8 +505,6 @@ static PyObject * typealias_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -552,10 +517,6 @@ typealias_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"name", "value", "type_params", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -591,4 +552,4 @@ typealias_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=d614edf64f28e346 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=32cbabc9b80ddefa input=a9049054013a1b77]*/ diff --git a/Objects/clinic/unicodeobject.c.h b/Objects/clinic/unicodeobject.c.h index 56b64087d6654af..e321c95806c2b27 100644 --- a/Objects/clinic/unicodeobject.c.h +++ b/Objects/clinic/unicodeobject.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(EncodingMap_size__doc__, "size($self, /)\n" @@ -161,8 +158,6 @@ static PyObject * unicode_encode(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -175,10 +170,6 @@ unicode_encode(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"encoding", "errors", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -254,8 +245,6 @@ static PyObject * unicode_expandtabs(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -268,10 +257,6 @@ unicode_expandtabs(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyOb #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"tabsize", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -760,8 +745,6 @@ static PyObject * unicode_replace(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -774,10 +757,6 @@ unicode_replace(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObjec #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "", "count", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -971,8 +950,6 @@ static PyObject * unicode_split(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -985,10 +962,6 @@ unicode_split(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"sep", "maxsplit", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1093,8 +1066,6 @@ static PyObject * unicode_rsplit(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -1107,10 +1078,6 @@ unicode_rsplit(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"sep", "maxsplit", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1174,8 +1141,6 @@ static PyObject * unicode_splitlines(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1188,10 +1153,6 @@ unicode_splitlines(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyOb #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"keepends", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1422,8 +1383,6 @@ static PyObject * unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -1436,10 +1395,6 @@ unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"object", "encoding", "errors", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1505,4 +1460,4 @@ unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=a64776a3ea1c970c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fd8efe48db280158 input=a9049054013a1b77]*/ diff --git a/Objects/stringlib/clinic/transmogrify.h.h b/Objects/stringlib/clinic/transmogrify.h.h index d1adda4e979c149..1876a15f65a47ab 100644 --- a/Objects/stringlib/clinic/transmogrify.h.h +++ b/Objects/stringlib/clinic/transmogrify.h.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(stringlib_expandtabs__doc__, "expandtabs($self, /, tabsize=8)\n" @@ -27,8 +24,6 @@ static PyObject * stringlib_expandtabs(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -41,10 +36,6 @@ stringlib_expandtabs(PyObject *self, PyObject *const *args, Py_ssize_t nargs, Py #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"tabsize", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -279,4 +270,4 @@ stringlib_zfill(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=a0338b2d41671b17 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d1985ad10836c24c input=a9049054013a1b77]*/ diff --git a/PC/_testconsole.c b/PC/_testconsole.c index 3221b985d01ba0c..d0d3f84d8ebacec 100644 --- a/PC/_testconsole.c +++ b/PC/_testconsole.c @@ -5,6 +5,10 @@ # define Py_BUILD_CORE_MODULE 1 #endif +// Argument Clinic avoids the internal C API, since _testconsole is built as a +// shared extension which cannot use the _Py_ID() API on Windows. +#define Py_ARGUMENT_CLINIC_AVOID_INTERNAL_CAPI + #include "Python.h" #ifdef MS_WINDOWS diff --git a/PC/clinic/_testconsole.c.h b/PC/clinic/_testconsole.c.h index b2f3b4ce8b08a2e..a82c7d90af95650 100644 --- a/PC/clinic/_testconsole.c.h +++ b/PC/clinic/_testconsole.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - #if defined(MS_WINDOWS) PyDoc_STRVAR(_testconsole_write_input__doc__, @@ -27,23 +21,7 @@ static PyObject * _testconsole_write_input(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - - #define NUM_KEYWORDS 2 - static struct { - PyGC_Head _this_is_not_used; - PyObject_VAR_HEAD - PyObject *ob_item[NUM_KEYWORDS]; - } _kwtuple = { - .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) - .ob_item = { &_Py_ID(file), &_Py_ID(s), }, - }; - #undef NUM_KEYWORDS - #define KWTUPLE (&_kwtuple.ob_base.ob_base) - - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE + #define KWTUPLE NULL static const char * const _keywords[] = {"file", "s", NULL}; static _PyArg_Parser _parser = { @@ -92,23 +70,7 @@ static PyObject * _testconsole_read_output(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - - #define NUM_KEYWORDS 1 - static struct { - PyGC_Head _this_is_not_used; - PyObject_VAR_HEAD - PyObject *ob_item[NUM_KEYWORDS]; - } _kwtuple = { - .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) - .ob_item = { &_Py_ID(file), }, - }; - #undef NUM_KEYWORDS - #define KWTUPLE (&_kwtuple.ob_base.ob_base) - - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE + #define KWTUPLE NULL static const char * const _keywords[] = {"file", NULL}; static _PyArg_Parser _parser = { @@ -140,4 +102,4 @@ _testconsole_read_output(PyObject *module, PyObject *const *args, Py_ssize_t nar #ifndef _TESTCONSOLE_READ_OUTPUT_METHODDEF #define _TESTCONSOLE_READ_OUTPUT_METHODDEF #endif /* !defined(_TESTCONSOLE_READ_OUTPUT_METHODDEF) */ -/*[clinic end generated code: output=208c72e2c873555b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=071ae35b5b677fae input=a9049054013a1b77]*/ diff --git a/PC/clinic/_wmimodule.cpp.h b/PC/clinic/_wmimodule.cpp.h index bfcad41750b319c..1686f4a35d36455 100644 --- a/PC/clinic/_wmimodule.cpp.h +++ b/PC/clinic/_wmimodule.cpp.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_wmi_exec_query__doc__, "exec_query($module, /, query)\n" @@ -27,8 +24,6 @@ static PyObject * _wmi_exec_query(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -41,10 +36,6 @@ _wmi_exec_query(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"query", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -69,4 +60,4 @@ _wmi_exec_query(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj exit: return return_value; } -/*[clinic end generated code: output=923d09bee1d15c5f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=dccb2d0e94277d9b input=a9049054013a1b77]*/ diff --git a/PC/clinic/msvcrtmodule.c.h b/PC/clinic/msvcrtmodule.c.h index af6710af9657e40..e2959a0fda1c525 100644 --- a/PC/clinic/msvcrtmodule.c.h +++ b/PC/clinic/msvcrtmodule.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(msvcrt_heapmin__doc__, "heapmin($module, /)\n" "--\n" @@ -701,4 +695,4 @@ msvcrt_SetErrorMode(PyObject *module, PyObject *arg) #ifndef MSVCRT_GETERRORMODE_METHODDEF #define MSVCRT_GETERRORMODE_METHODDEF #endif /* !defined(MSVCRT_GETERRORMODE_METHODDEF) */ -/*[clinic end generated code: output=f70de1b6d0e700cd input=a9049054013a1b77]*/ +/*[clinic end generated code: output=97e00f191821d4c0 input=a9049054013a1b77]*/ diff --git a/PC/clinic/winreg.c.h b/PC/clinic/winreg.c.h index 6e23929c185caf4..cec0bce3c9dc5c1 100644 --- a/PC/clinic/winreg.c.h +++ b/PC/clinic/winreg.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head #include "pycore_long.h" // _PyLong_UnsignedLong_Converter() +#include "pycore_runtime.h" // _Py_ID() #if (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM) || defined(MS_WINDOWS_GAMES)) @@ -318,8 +315,6 @@ static PyObject * winreg_CreateKeyEx(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -332,10 +327,6 @@ winreg_CreateKeyEx(PyObject *module, PyObject *const *args, Py_ssize_t nargs, Py #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"key", "sub_key", "reserved", "access", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -502,8 +493,6 @@ static PyObject * winreg_DeleteKeyEx(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -516,10 +505,6 @@ winreg_DeleteKeyEx(PyObject *module, PyObject *const *args, Py_ssize_t nargs, Py #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"key", "sub_key", "access", "reserved", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -933,8 +918,6 @@ static PyObject * winreg_OpenKey(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -947,10 +930,6 @@ winreg_OpenKey(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"key", "sub_key", "reserved", "access", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1050,8 +1029,6 @@ static PyObject * winreg_OpenKeyEx(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -1064,10 +1041,6 @@ winreg_OpenKeyEx(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"key", "sub_key", "reserved", "access", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1762,4 +1735,4 @@ winreg_QueryReflectionKey(PyObject *module, PyObject *arg) #ifndef WINREG_QUERYREFLECTIONKEY_METHODDEF #define WINREG_QUERYREFLECTIONKEY_METHODDEF #endif /* !defined(WINREG_QUERYREFLECTIONKEY_METHODDEF) */ -/*[clinic end generated code: output=2431b1b06b148722 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=39d40b0ee660abac input=a9049054013a1b77]*/ diff --git a/PC/clinic/winsound.c.h b/PC/clinic/winsound.c.h index d35261253557dab..d5bf7ffd343accb 100644 --- a/PC/clinic/winsound.c.h +++ b/PC/clinic/winsound.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(winsound_PlaySound__doc__, "PlaySound($module, /, sound, flags)\n" @@ -29,8 +26,6 @@ static PyObject * winsound_PlaySound(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -43,10 +38,6 @@ winsound_PlaySound(PyObject *module, PyObject *const *args, Py_ssize_t nargs, Py #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"sound", "flags", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -95,8 +86,6 @@ static PyObject * winsound_Beep(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -109,10 +98,6 @@ winsound_Beep(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"frequency", "duration", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -160,8 +145,6 @@ static PyObject * winsound_MessageBeep(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -174,10 +157,6 @@ winsound_MessageBeep(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"type", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -206,4 +185,4 @@ winsound_MessageBeep(PyObject *module, PyObject *const *args, Py_ssize_t nargs, exit: return return_value; } -/*[clinic end generated code: output=e63a6516d7a55cb8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9eb7b72b334f6644 input=a9049054013a1b77]*/ diff --git a/Python/clinic/Python-tokenize.c.h b/Python/clinic/Python-tokenize.c.h index 28f5075826e36f3..2db172a524a07f0 100644 --- a/Python/clinic/Python-tokenize.c.h +++ b/Python/clinic/Python-tokenize.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() static PyObject * tokenizeriter_new_impl(PyTypeObject *type, PyObject *readline, @@ -16,8 +13,6 @@ static PyObject * tokenizeriter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -30,10 +25,6 @@ tokenizeriter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "extra_tokens", "encoding", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -80,4 +71,4 @@ tokenizeriter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=48be65a2808bdfa6 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=938287626397ffea input=a9049054013a1b77]*/ diff --git a/Python/clinic/_warnings.c.h b/Python/clinic/_warnings.c.h index 1a01416e7363c7a..f3787bc2c45cef9 100644 --- a/Python/clinic/_warnings.c.h +++ b/Python/clinic/_warnings.c.h @@ -2,12 +2,9 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - #include "pycore_abstract.h" // _PyNumber_Index() +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(warnings_warn__doc__, "warn($module, /, message, category=None, stacklevel=1, source=None, *,\n" @@ -41,8 +38,6 @@ static PyObject * warnings_warn(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -55,10 +50,6 @@ warnings_warn(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"message", "category", "stacklevel", "source", "skip_file_prefixes", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -148,8 +139,6 @@ static PyObject * warnings_warn_explicit(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 8 static struct { PyGC_Head _this_is_not_used; @@ -162,10 +151,6 @@ warnings_warn_explicit(PyObject *module, PyObject *const *args, Py_ssize_t nargs #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"message", "category", "filename", "lineno", "module", "registry", "module_globals", "source", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -244,4 +229,4 @@ warnings_filters_mutated(PyObject *module, PyObject *Py_UNUSED(ignored)) { return warnings_filters_mutated_impl(module); } -/*[clinic end generated code: output=c8a6dc1403fba1d5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c7ea85d4cef86698 input=a9049054013a1b77]*/ diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h index b0d6929aa50dc8d..9c48920d327792d 100644 --- a/Python/clinic/bltinmodule.c.h +++ b/Python/clinic/bltinmodule.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(builtin___import____doc__, "__import__($module, /, name, globals=None, locals=None, fromlist=(),\n" @@ -40,8 +37,6 @@ static PyObject * builtin___import__(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 5 static struct { PyGC_Head _this_is_not_used; @@ -54,10 +49,6 @@ builtin___import__(PyObject *module, PyObject *const *args, Py_ssize_t nargs, Py #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"name", "globals", "locals", "fromlist", "level", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -282,8 +273,6 @@ static PyObject * builtin_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 7 static struct { PyGC_Head _this_is_not_used; @@ -296,10 +285,6 @@ builtin_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"source", "filename", "mode", "flags", "dont_inherit", "optimize", "_feature_version", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -484,8 +469,6 @@ static PyObject * builtin_exec(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -498,10 +481,6 @@ builtin_exec(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "", "", "closure", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -818,8 +797,6 @@ static PyObject * builtin_pow(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 3 static struct { PyGC_Head _this_is_not_used; @@ -832,10 +809,6 @@ builtin_pow(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"base", "exp", "mod", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -892,8 +865,6 @@ static PyObject * builtin_print(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -906,10 +877,6 @@ builtin_print(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"sep", "end", "file", "flush", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1031,8 +998,6 @@ static PyObject * builtin_round(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -1045,10 +1010,6 @@ builtin_round(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"number", "ndigits", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1097,8 +1058,6 @@ static PyObject * builtin_sum(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1111,10 +1070,6 @@ builtin_sum(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "start", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1212,4 +1167,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=bb2da8ccae4190e9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=516e50e75dcd351b input=a9049054013a1b77]*/ diff --git a/Python/clinic/context.c.h b/Python/clinic/context.c.h index 27c375717bff96c..292d3f7f4ff49c7 100644 --- a/Python/clinic/context.c.h +++ b/Python/clinic/context.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(_contextvars_Context_get__doc__, "get($self, key, default=None, /)\n" "--\n" @@ -183,4 +177,4 @@ PyDoc_STRVAR(_contextvars_ContextVar_reset__doc__, #define _CONTEXTVARS_CONTEXTVAR_RESET_METHODDEF \ {"reset", (PyCFunction)_contextvars_ContextVar_reset, METH_O, _contextvars_ContextVar_reset__doc__}, -/*[clinic end generated code: output=0c94d4b919500438 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2436b16a92452869 input=a9049054013a1b77]*/ diff --git a/Python/clinic/import.c.h b/Python/clinic/import.c.h index fd54033b7e7ac83..9a027916bcebdfc 100644 --- a/Python/clinic/import.c.h +++ b/Python/clinic/import.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(_imp_lock_held__doc__, "lock_held($module, /)\n" @@ -193,8 +190,6 @@ static PyObject * _imp_find_frozen(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -207,10 +202,6 @@ _imp_find_frozen(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"", "withdata", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -565,8 +556,6 @@ static PyObject * _imp_source_hash(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 static struct { PyGC_Head _this_is_not_used; @@ -579,10 +568,6 @@ _imp_source_hash(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"key", "source", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -627,4 +612,4 @@ _imp_source_hash(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #ifndef _IMP_EXEC_DYNAMIC_METHODDEF #define _IMP_EXEC_DYNAMIC_METHODDEF #endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */ -/*[clinic end generated code: output=d97b56ef622cb28a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=13dd88597c5339ad input=a9049054013a1b77]*/ diff --git a/Python/clinic/instrumentation.c.h b/Python/clinic/instrumentation.c.h index c97fb977ad3457b..1b1b6d048b0dd0d 100644 --- a/Python/clinic/instrumentation.c.h +++ b/Python/clinic/instrumentation.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(monitoring_use_tool_id__doc__, "use_tool_id($module, tool_id, name, /)\n" "--\n" @@ -308,4 +302,4 @@ monitoring__all_events(PyObject *module, PyObject *Py_UNUSED(ignored)) { return monitoring__all_events_impl(module); } -/*[clinic end generated code: output=8baabc8341df3f0e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=46f449b18195f976 input=a9049054013a1b77]*/ diff --git a/Python/clinic/marshal.c.h b/Python/clinic/marshal.c.h index 102e637ec183301..16e48f77c87fdbe 100644 --- a/Python/clinic/marshal.c.h +++ b/Python/clinic/marshal.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(marshal_dump__doc__, "dump($module, value, file, version=version, /)\n" "--\n" @@ -161,4 +155,4 @@ marshal_loads(PyObject *module, PyObject *arg) return return_value; } -/*[clinic end generated code: output=0f4ecfd941293f67 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=23091e077319f596 input=a9049054013a1b77]*/ diff --git a/Python/clinic/sysmodule.c.h b/Python/clinic/sysmodule.c.h index 1f751e48d3e0fef..620954d1552af36 100644 --- a/Python/clinic/sysmodule.c.h +++ b/Python/clinic/sysmodule.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(sys_addaudithook__doc__, "addaudithook($module, /, hook)\n" @@ -24,8 +21,6 @@ static PyObject * sys_addaudithook(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -38,10 +33,6 @@ sys_addaudithook(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"hook", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -475,8 +466,6 @@ static PyObject * sys_set_coroutine_origin_tracking_depth(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -489,10 +478,6 @@ sys_set_coroutine_origin_tracking_depth(PyObject *module, PyObject *const *args, #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"depth", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -776,8 +761,6 @@ static PyObject * sys_set_int_max_str_digits(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -790,10 +773,6 @@ sys_set_int_max_str_digits(PyObject *module, PyObject *const *args, Py_ssize_t n #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"maxdigits", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1322,8 +1301,6 @@ static PyObject * sys__getframemodulename(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 1 static struct { PyGC_Head _this_is_not_used; @@ -1336,10 +1313,6 @@ sys__getframemodulename(PyObject *module, PyObject *const *args, Py_ssize_t narg #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"depth", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -1412,4 +1385,4 @@ sys__getframemodulename(PyObject *module, PyObject *const *args, Py_ssize_t narg #ifndef SYS_GETANDROIDAPILEVEL_METHODDEF #define SYS_GETANDROIDAPILEVEL_METHODDEF #endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */ -/*[clinic end generated code: output=6de02cd7d925d1de input=a9049054013a1b77]*/ +/*[clinic end generated code: output=64bfda7a7930fe25 input=a9049054013a1b77]*/ diff --git a/Python/clinic/traceback.c.h b/Python/clinic/traceback.c.h index 1a0eaf9e91b3c15..ca09adc2d82dff1 100644 --- a/Python/clinic/traceback.c.h +++ b/Python/clinic/traceback.c.h @@ -2,11 +2,8 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - +#include "pycore_gc.h" // PyGC_Head +#include "pycore_runtime.h" // _Py_ID() PyDoc_STRVAR(tb_new__doc__, "TracebackType(tb_next, tb_frame, tb_lasti, tb_lineno)\n" @@ -22,8 +19,6 @@ static PyObject * tb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 4 static struct { PyGC_Head _this_is_not_used; @@ -36,10 +31,6 @@ tb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE - static const char * const _keywords[] = {"tb_next", "tb_frame", "tb_lasti", "tb_lineno", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, @@ -78,4 +69,4 @@ tb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=6303f910c04227a4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5b771625ebba06fa input=a9049054013a1b77]*/ diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index ec5bf302416ba85..d7d8ff7c24cbbaa 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -77,7 +77,10 @@ "noptargs", "return_value", } -LIMITED_CAPI_REGEX = re.compile(r'#define +Py_LIMITED_API') +# match '#define Py_LIMITED_API' +LIMITED_CAPI_REGEX = re.compile(r'# *define +Py_LIMITED_API') +# match '#define Py_ARGUMENT_CLINIC_AVOID_INTERNAL_CAPI' +AVOID_INTERNAL_CAPI_REGEX = re.compile(r'# *define +Py_ARGUMENT_CLINIC_AVOID_INTERNAL_CAPI') class Sentinels(enum.Enum): @@ -674,8 +677,10 @@ def normalize_snippet( def declare_parser( f: Function, + clinic: Clinic, *, - hasformat: bool = False + hasformat: bool = False, + internal_capi: bool, ) -> str: """ Generates the code template for a static local PyArg_Parser variable, @@ -702,10 +707,8 @@ def declare_parser( # define KWTUPLE NULL #endif """ - else: + elif internal_capi: declarations = """ - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS %d static struct {{ PyGC_Head _this_is_not_used; @@ -717,11 +720,12 @@ def declare_parser( }}; #undef NUM_KEYWORDS #define KWTUPLE (&_kwtuple.ob_base.ob_base) - - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE """ % num_keywords + clinic.add_include('pycore_gc.h', 'PyGC_Head') + else: + declarations = """ + #define KWTUPLE NULL + """ declarations += """ static const char * const _keywords[] = {{{keywords_c} NULL}}; @@ -976,6 +980,7 @@ def deprecate_keyword_use( argname_fmt: str | None, *, limited_capi: bool, + clinic: Clinic, ) -> str: assert len(params) > 0 last_param = next(reversed(params.values())) @@ -990,9 +995,11 @@ def deprecate_keyword_use( elif func.kind.new_or_init or limited_capi: conditions.append(f"nargs < {i+1} && PyDict_Contains(kwargs, &_Py_ID({p.name}))") containscheck = "PyDict_Contains" + clinic.add_include('pycore_runtime.h', '_Py_ID()') else: conditions.append(f"nargs < {i+1} && PySequence_Contains(kwnames, &_Py_ID({p.name}))") containscheck = "PySequence_Contains" + clinic.add_include('pycore_runtime.h', '_Py_ID()') else: conditions = [f"nargs < {i+1}"] condition = ") || (".join(conditions) @@ -1415,14 +1422,16 @@ def parser_body( declarations += "\nPy_ssize_t nargs = PyTuple_Size(args);" if deprecated_keywords: code = self.deprecate_keyword_use(f, deprecated_keywords, None, - limited_capi=limited_capi) + limited_capi=limited_capi, + clinic=clinic) parser_code.append(code) elif not new_or_init: flags = "METH_FASTCALL|METH_KEYWORDS" parser_prototype = self.PARSER_PROTOTYPE_FASTCALL_KEYWORDS argname_fmt = 'args[%d]' - declarations = declare_parser(f) + declarations = declare_parser(f, clinic, + internal_capi=clinic.internal_capi) declarations += "\nPyObject *argsbuf[%s];" % len(converters) if has_optional_kw: declarations += "\nPy_ssize_t noptargs = %s + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - %d;" % (nargs, min_pos + min_kw_only) @@ -1437,7 +1446,8 @@ def parser_body( flags = "METH_VARARGS|METH_KEYWORDS" parser_prototype = self.PARSER_PROTOTYPE_KEYWORD argname_fmt = 'fastargs[%d]' - declarations = declare_parser(f) + declarations = declare_parser(f, clinic, + internal_capi=clinic.internal_capi) declarations += "\nPyObject *argsbuf[%s];" % len(converters) declarations += "\nPyObject * const *fastargs;" declarations += "\nPy_ssize_t nargs = PyTuple_GET_SIZE(args);" @@ -1457,7 +1467,8 @@ def parser_body( if not limited_capi: if deprecated_keywords: code = self.deprecate_keyword_use(f, deprecated_keywords, argname_fmt, - limited_capi=limited_capi) + limited_capi=limited_capi, + clinic=clinic) parser_code.append(code) add_label: str | None = None @@ -1522,7 +1533,8 @@ def parser_body( if add_label: parser_code.append("%s:" % add_label) else: - declarations = declare_parser(f, hasformat=True) + declarations = declare_parser(f, clinic, hasformat=True, + internal_capi=clinic.internal_capi) if not new_or_init: parser_code = [normalize_snippet(""" if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser{parse_arguments_comma} @@ -1541,7 +1553,8 @@ def parser_body( declarations += "\nPy_ssize_t nargs = PyTuple_GET_SIZE(args);" if deprecated_keywords: code = self.deprecate_keyword_use(f, deprecated_keywords, None, - limited_capi=limited_capi) + limited_capi=limited_capi, + clinic=clinic) parser_code.append(code) if deprecated_positionals: @@ -1852,8 +1865,13 @@ def render_function( template_dict['keywords_c'] = ' '.join('"' + k + '",' for k in data.keywords) keywords = [k for k in data.keywords if k] - template_dict['keywords_py'] = ' '.join('&_Py_ID(' + k + '),' - for k in keywords) + # avoid internal pycore_runtime.h if there is no keywords + if keywords and clinic.internal_capi: + template_dict['keywords_py'] = ' '.join('&_Py_ID(' + k + '),' + for k in keywords) + clinic.add_include('pycore_runtime.h', '_Py_ID()') + else: + template_dict['keywords_py'] = '' template_dict['format_units'] = ''.join(data.format_units) template_dict['parse_arguments'] = ', '.join(data.parse_arguments) if data.parse_arguments: @@ -2179,7 +2197,6 @@ def print_block( block: Block, *, core_includes: bool = False, - limited_capi: bool, header_includes: dict[str, str], ) -> None: input = block.input @@ -2209,15 +2226,8 @@ def print_block( write("\n") output = '' - if core_includes: - if not limited_capi: - output += textwrap.dedent(""" - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - # include "pycore_gc.h" // PyGC_Head - # include "pycore_runtime.h" // _Py_ID() - #endif - - """) + if core_includes and header_includes: + output += "\n" # Emit optional "#include" directives for C headers for include, reason in sorted(header_includes.items()): @@ -2419,6 +2429,7 @@ def __init__( *, filename: str, limited_capi: bool, + internal_capi: bool, verify: bool = True, ) -> None: # maps strings to Parser objects. @@ -2430,6 +2441,7 @@ def __init__( self.printer = printer or BlockPrinter(language) self.verify = verify self.limited_capi = limited_capi + self.internal_capi = internal_capi self.filename = filename self.modules: ModuleDict = {} self.classes: ClassDict = {} @@ -2537,7 +2549,6 @@ def parse(self, input: str) -> str: parser = self.parsers[dsl_name] parser.parse(block) printer.print_block(block, - limited_capi=self.limited_capi, header_includes=self.includes) # these are destinations not buffers @@ -2554,7 +2565,6 @@ def parse(self, input: str) -> str: warn("Destination buffer " + repr(name) + " not empty at end of file, emptying.") printer.write("\n") printer.print_block(block, - limited_capi=self.limited_capi, header_includes=self.includes) continue @@ -2582,7 +2592,6 @@ def parse(self, input: str) -> str: printer_2 = BlockPrinter(self.language) printer_2.print_block(block, core_includes=True, - limited_capi=self.limited_capi, header_includes=self.includes) write_file(destination.filename, printer_2.f.getvalue()) continue @@ -2650,11 +2659,18 @@ def parse_file( if LIMITED_CAPI_REGEX.search(raw): limited_capi = True + internal_capi = True + if limited_capi: + internal_capi = False + elif AVOID_INTERNAL_CAPI_REGEX.search(raw): + internal_capi = False + assert isinstance(language, CLanguage) clinic = Clinic(language, verify=verify, filename=filename, - limited_capi=limited_capi) + limited_capi=limited_capi, + internal_capi=internal_capi) cooked = clinic.parse(raw) write_file(output, cooked)