]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-110964: Remove private _PyArg functions (#110966)
authorVictor Stinner <vstinner@python.org>
Tue, 17 Oct 2023 12:30:31 +0000 (14:30 +0200)
committerGitHub <noreply@github.com>
Tue, 17 Oct 2023 12:30:31 +0000 (14:30 +0200)
Move the following private functions and structures to
pycore_modsupport.h internal C API:

* _PyArg_BadArgument()
* _PyArg_CheckPositional()
* _PyArg_NoKeywords()
* _PyArg_NoPositional()
* _PyArg_ParseStack()
* _PyArg_ParseStackAndKeywords()
* _PyArg_Parser structure
* _PyArg_UnpackKeywords()
* _PyArg_UnpackKeywordsWithVararg()
* _PyArg_UnpackStack()
* _Py_ANY_VARARGS()

Changes:

* Python/getargs.h now includes pycore_modsupport.h to export
  functions.
* clinic.py now adds pycore_modsupport.h when one of these functions
  is used.
* Add pycore_modsupport.h includes when a C extension uses one of
  these functions.
* Define Py_BUILD_CORE_MODULE in C extensions which now include
  directly or indirectly (via code generated by Argument Clinic)
  pycore_modsupport.h:

  * _csv
  * _curses_panel
  * _dbm
  * _gdbm
  * _multiprocessing.posixshmem
  * _sqlite.row
  * _statistics
  * grp
  * resource
  * syslog

* _testcapi: bad_get() no longer uses METH_FASTCALL calling
  convention but METH_VARARGS. Replace _PyArg_UnpackStack() with
  PyArg_ParseTuple().
* _testcapi: add PYTESTCAPI_NEED_INTERNAL_API macro which is defined
  by _testcapi sub-modules which need the internal C API
  (pycore_modsupport.h): exceptions.c, float.c, vectorcall.c,
  watchers.c.
* Remove Include/cpython/modsupport.h header file.
  Include/modsupport.h no longer includes the removed header file.
* Fix mypy clinic.py

166 files changed:
Include/cpython/modsupport.h [deleted file]
Include/internal/pycore_modsupport.h
Include/modsupport.h
Makefile.pre.in
Misc/NEWS.d/next/C API/2023-10-17-10-21-59.gh-issue-110964.OxqEjd.rst [new file with mode: 0644]
Modules/_asynciomodule.c
Modules/_blake2/clinic/blake2b_impl.c.h
Modules/_blake2/clinic/blake2s_impl.c.h
Modules/_csv.c
Modules/_ctypes/_ctypes.c
Modules/_curses_panel.c
Modules/_dbmmodule.c
Modules/_gdbmmodule.c
Modules/_io/clinic/_iomodule.c.h
Modules/_io/clinic/bufferedio.c.h
Modules/_io/clinic/bytesio.c.h
Modules/_io/clinic/fileio.c.h
Modules/_io/clinic/iobase.c.h
Modules/_io/clinic/stringio.c.h
Modules/_io/clinic/textio.c.h
Modules/_io/clinic/winconsoleio.c.h
Modules/_multiprocessing/clinic/multiprocessing.c.h
Modules/_multiprocessing/clinic/posixshmem.c.h
Modules/_multiprocessing/clinic/semaphore.c.h
Modules/_multiprocessing/posixshmem.c
Modules/_randommodule.c
Modules/_sqlite/clinic/_sqlite3.connect.c.h
Modules/_sqlite/clinic/blob.c.h
Modules/_sqlite/clinic/connection.c.h
Modules/_sqlite/clinic/cursor.c.h
Modules/_sqlite/clinic/module.c.h
Modules/_sqlite/clinic/row.c.h
Modules/_sqlite/connection.c
Modules/_sqlite/row.c
Modules/_sre/clinic/sre.c.h
Modules/_ssl/clinic/cert.c.h
Modules/_statisticsmodule.c
Modules/_testcapi/clinic/exceptions.c.h
Modules/_testcapi/clinic/float.c.h
Modules/_testcapi/clinic/vectorcall.c.h
Modules/_testcapi/clinic/watchers.c.h
Modules/_testcapi/exceptions.c
Modules/_testcapi/float.c
Modules/_testcapi/parts.h
Modules/_testcapi/vectorcall.c
Modules/_testcapi/watchers.c
Modules/_testcapimodule.c
Modules/_testinternalcapi/clinic/test_lock.c.h
Modules/_testmultiphase.c
Modules/_xxsubinterpretersmodule.c
Modules/arraymodule.c
Modules/cjkcodecs/clinic/multibytecodec.c.h
Modules/clinic/_abc.c.h
Modules/clinic/_asynciomodule.c.h
Modules/clinic/_bisectmodule.c.h
Modules/clinic/_bz2module.c.h
Modules/clinic/_codecsmodule.c.h
Modules/clinic/_collectionsmodule.c.h
Modules/clinic/_csv.c.h
Modules/clinic/_curses_panel.c.h
Modules/clinic/_cursesmodule.c.h
Modules/clinic/_datetimemodule.c.h
Modules/clinic/_dbmmodule.c.h
Modules/clinic/_elementtree.c.h
Modules/clinic/_functoolsmodule.c.h
Modules/clinic/_gdbmmodule.c.h
Modules/clinic/_hashopenssl.c.h
Modules/clinic/_heapqmodule.c.h
Modules/clinic/_localemodule.c.h
Modules/clinic/_lzmamodule.c.h
Modules/clinic/_opcode.c.h
Modules/clinic/_operator.c.h
Modules/clinic/_pickle.c.h
Modules/clinic/_posixsubprocess.c.h
Modules/clinic/_queuemodule.c.h
Modules/clinic/_randommodule.c.h
Modules/clinic/_ssl.c.h
Modules/clinic/_statisticsmodule.c.h
Modules/clinic/_struct.c.h
Modules/clinic/_testclinic.c.h
Modules/clinic/_testclinic_depr.c.h
Modules/clinic/_testinternalcapi.c.h
Modules/clinic/_testmultiphase.c.h
Modules/clinic/_tkinter.c.h
Modules/clinic/_tracemalloc.c.h
Modules/clinic/_weakref.c.h
Modules/clinic/_winapi.c.h
Modules/clinic/_zoneinfo.c.h
Modules/clinic/arraymodule.c.h
Modules/clinic/binascii.c.h
Modules/clinic/cmathmodule.c.h
Modules/clinic/fcntlmodule.c.h
Modules/clinic/gcmodule.c.h
Modules/clinic/grpmodule.c.h
Modules/clinic/itertoolsmodule.c.h
Modules/clinic/mathmodule.c.h
Modules/clinic/overlapped.c.h
Modules/clinic/posixmodule.c.h
Modules/clinic/pwdmodule.c.h
Modules/clinic/pyexpat.c.h
Modules/clinic/readline.c.h
Modules/clinic/resource.c.h
Modules/clinic/selectmodule.c.h
Modules/clinic/sha1module.c.h
Modules/clinic/sha2module.c.h
Modules/clinic/sha3module.c.h
Modules/clinic/signalmodule.c.h
Modules/clinic/socketmodule.c.h
Modules/clinic/symtablemodule.c.h
Modules/clinic/syslogmodule.c.h
Modules/clinic/termios.c.h
Modules/clinic/unicodedata.c.h
Modules/clinic/zlibmodule.c.h
Modules/grpmodule.c
Modules/resource.c
Modules/syslogmodule.c
Objects/cellobject.c
Objects/clinic/bytearrayobject.c.h
Objects/clinic/bytesobject.c.h
Objects/clinic/classobject.c.h
Objects/clinic/codeobject.c.h
Objects/clinic/complexobject.c.h
Objects/clinic/descrobject.c.h
Objects/clinic/dictobject.c.h
Objects/clinic/enumobject.c.h
Objects/clinic/floatobject.c.h
Objects/clinic/funcobject.c.h
Objects/clinic/listobject.c.h
Objects/clinic/longobject.c.h
Objects/clinic/memoryobject.c.h
Objects/clinic/moduleobject.c.h
Objects/clinic/odictobject.c.h
Objects/clinic/structseq.c.h
Objects/clinic/tupleobject.c.h
Objects/clinic/typeobject.c.h
Objects/clinic/typevarobject.c.h
Objects/clinic/unicodeobject.c.h
Objects/descrobject.c
Objects/exceptions.c
Objects/funcobject.c
Objects/genericaliasobject.c
Objects/genobject.c
Objects/namespaceobject.c
Objects/sliceobject.c
Objects/stringlib/clinic/transmogrify.h.h
Objects/structseq.c
PC/_wmimodule.cpp
PC/clinic/_testconsole.c.h
PC/clinic/_wmimodule.cpp.h
PC/clinic/msvcrtmodule.c.h
PC/clinic/winreg.c.h
PC/clinic/winsound.c.h
PC/winsound.c
PCbuild/pythoncore.vcxproj
PCbuild/pythoncore.vcxproj.filters
Python/clinic/Python-tokenize.c.h
Python/clinic/_warnings.c.h
Python/clinic/bltinmodule.c.h
Python/clinic/context.c.h
Python/clinic/import.c.h
Python/clinic/instrumentation.c.h
Python/clinic/marshal.c.h
Python/clinic/sysmodule.c.h
Python/clinic/traceback.c.h
Python/getargs.c
Tools/clinic/clinic.py

diff --git a/Include/cpython/modsupport.h b/Include/cpython/modsupport.h
deleted file mode 100644 (file)
index cfc2c2c..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#ifndef Py_CPYTHON_MODSUPPORT_H
-#  error "this header file must not be included directly"
-#endif
-
-PyAPI_FUNC(int) _PyArg_UnpackStack(
-    PyObject *const *args,
-    Py_ssize_t nargs,
-    const char *name,
-    Py_ssize_t min,
-    Py_ssize_t max,
-    ...);
-
-PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kwargs);
-PyAPI_FUNC(int) _PyArg_NoPositional(const char *funcname, PyObject *args);
-#define _PyArg_NoKeywords(funcname, kwargs) \
-    ((kwargs) == NULL || _PyArg_NoKeywords((funcname), (kwargs)))
-#define _PyArg_NoPositional(funcname, args) \
-    ((args) == NULL || _PyArg_NoPositional((funcname), (args)))
-
-#define _Py_ANY_VARARGS(n) ((n) == PY_SSIZE_T_MAX)
-
-PyAPI_FUNC(void) _PyArg_BadArgument(const char *, const char *, const char *, PyObject *);
-PyAPI_FUNC(int) _PyArg_CheckPositional(const char *, Py_ssize_t,
-                                       Py_ssize_t, Py_ssize_t);
-#define _PyArg_CheckPositional(funcname, nargs, min, max) \
-    ((!_Py_ANY_VARARGS(max) && (min) <= (nargs) && (nargs) <= (max)) \
-     || _PyArg_CheckPositional((funcname), (nargs), (min), (max)))
-
-typedef struct _PyArg_Parser {
-    int initialized;
-    const char *format;
-    const char * const *keywords;
-    const char *fname;
-    const char *custom_msg;
-    int pos;            /* number of positional-only arguments */
-    int min;            /* minimal number of arguments */
-    int max;            /* maximal number of positional arguments */
-    PyObject *kwtuple;  /* tuple of keyword parameter names */
-    struct _PyArg_Parser *next;
-} _PyArg_Parser;
-
-PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast(PyObject *, PyObject *,
-                                                 struct _PyArg_Parser *, ...);
-PyAPI_FUNC(int) _PyArg_ParseStack(
-    PyObject *const *args,
-    Py_ssize_t nargs,
-    const char *format,
-    ...);
-PyAPI_FUNC(int) _PyArg_ParseStackAndKeywords(
-    PyObject *const *args,
-    Py_ssize_t nargs,
-    PyObject *kwnames,
-    struct _PyArg_Parser *,
-    ...);
-PyAPI_FUNC(PyObject * const *) _PyArg_UnpackKeywords(
-        PyObject *const *args, Py_ssize_t nargs,
-        PyObject *kwargs, PyObject *kwnames,
-        struct _PyArg_Parser *parser,
-        int minpos, int maxpos, int minkw,
-        PyObject **buf);
-
-PyAPI_FUNC(PyObject * const *) _PyArg_UnpackKeywordsWithVararg(
-        PyObject *const *args, Py_ssize_t nargs,
-        PyObject *kwargs, PyObject *kwnames,
-        struct _PyArg_Parser *parser,
-        int minpos, int maxpos, int minkw,
-        int vararg, PyObject **buf);
-
-#define _PyArg_UnpackKeywords(args, nargs, kwargs, kwnames, parser, minpos, maxpos, minkw, buf) \
-    (((minkw) == 0 && (kwargs) == NULL && (kwnames) == NULL && \
-      (minpos) <= (nargs) && (nargs) <= (maxpos) && (args) != NULL) ? (args) : \
-     _PyArg_UnpackKeywords((args), (nargs), (kwargs), (kwnames), (parser), \
-                           (minpos), (maxpos), (minkw), (buf)))
index e577c6ba856b77a8d5ae03e506dd7b240efb4b40..e12f3b72c8415b30fbdf0a9e4d3de2c956fa8f62 100644 (file)
@@ -13,6 +13,24 @@ extern int _PyArg_NoKwnames(const char *funcname, PyObject *kwnames);
 #define _PyArg_NoKwnames(funcname, kwnames) \
     ((kwnames) == NULL || _PyArg_NoKwnames((funcname), (kwnames)))
 
+// Export for '_bz2' shared extension
+PyAPI_FUNC(int) _PyArg_NoPositional(const char *funcname, PyObject *args);
+#define _PyArg_NoPositional(funcname, args) \
+    ((args) == NULL || _PyArg_NoPositional((funcname), (args)))
+
+// Export for '_asyncio' shared extension
+PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kwargs);
+#define _PyArg_NoKeywords(funcname, kwargs) \
+    ((kwargs) == NULL || _PyArg_NoKeywords((funcname), (kwargs)))
+
+// Export for 'zlib' shared extension
+PyAPI_FUNC(int) _PyArg_CheckPositional(const char *, Py_ssize_t,
+                                       Py_ssize_t, Py_ssize_t);
+#define _Py_ANY_VARARGS(n) ((n) == PY_SSIZE_T_MAX)
+#define _PyArg_CheckPositional(funcname, nargs, min, max) \
+    ((!_Py_ANY_VARARGS(max) && (min) <= (nargs) && (nargs) <= (max)) \
+     || _PyArg_CheckPositional((funcname), (nargs), (min), (max)))
+
 extern PyObject ** _Py_VaBuildStack(
     PyObject **small_stack,
     Py_ssize_t small_stack_len,
@@ -22,6 +40,80 @@ extern PyObject ** _Py_VaBuildStack(
 
 extern PyObject* _PyModule_CreateInitialized(PyModuleDef*, int apiver);
 
+// Export for '_curses' shared extension
+PyAPI_FUNC(int) _PyArg_ParseStack(
+    PyObject *const *args,
+    Py_ssize_t nargs,
+    const char *format,
+    ...);
+
+extern int _PyArg_UnpackStack(
+    PyObject *const *args,
+    Py_ssize_t nargs,
+    const char *name,
+    Py_ssize_t min,
+    Py_ssize_t max,
+    ...);
+
+// Export for '_heapq' shared extension
+PyAPI_FUNC(void) _PyArg_BadArgument(
+    const char *fname,
+    const char *displayname,
+    const char *expected,
+    PyObject *arg);
+
+// --- _PyArg_Parser API ---------------------------------------------------
+
+typedef struct _PyArg_Parser {
+    int initialized;
+    const char *format;
+    const char * const *keywords;
+    const char *fname;
+    const char *custom_msg;
+    int pos;            /* number of positional-only arguments */
+    int min;            /* minimal number of arguments */
+    int max;            /* maximal number of positional arguments */
+    PyObject *kwtuple;  /* tuple of keyword parameter names */
+    struct _PyArg_Parser *next;
+} _PyArg_Parser;
+
+// Export for '_testclinic' shared extension
+PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast(PyObject *, PyObject *,
+                                                 struct _PyArg_Parser *, ...);
+
+// Export for '_dbm' shared extension
+PyAPI_FUNC(int) _PyArg_ParseStackAndKeywords(
+    PyObject *const *args,
+    Py_ssize_t nargs,
+    PyObject *kwnames,
+    struct _PyArg_Parser *,
+    ...);
+
+// Export for 'math' shared extension
+PyAPI_FUNC(PyObject * const *) _PyArg_UnpackKeywords(
+    PyObject *const *args,
+    Py_ssize_t nargs,
+    PyObject *kwargs,
+    PyObject *kwnames,
+    struct _PyArg_Parser *parser,
+    int minpos,
+    int maxpos,
+    int minkw,
+    PyObject **buf);
+#define _PyArg_UnpackKeywords(args, nargs, kwargs, kwnames, parser, minpos, maxpos, minkw, buf) \
+    (((minkw) == 0 && (kwargs) == NULL && (kwnames) == NULL && \
+      (minpos) <= (nargs) && (nargs) <= (maxpos) && (args) != NULL) ? (args) : \
+     _PyArg_UnpackKeywords((args), (nargs), (kwargs), (kwnames), (parser), \
+                           (minpos), (maxpos), (minkw), (buf)))
+
+// Export for '_testclinic' shared extension
+PyAPI_FUNC(PyObject * const *) _PyArg_UnpackKeywordsWithVararg(
+        PyObject *const *args, Py_ssize_t nargs,
+        PyObject *kwargs, PyObject *kwnames,
+        struct _PyArg_Parser *parser,
+        int minpos, int maxpos, int minkw,
+        int vararg, PyObject **buf);
+
 #ifdef __cplusplus
 }
 #endif
index 6efe9dfaa9089e18e0460348e8d770226f82a342..450cc99c404c17007eeddd9d6c9f0588a5404baf 100644 (file)
@@ -134,12 +134,6 @@ PyAPI_FUNC(PyObject *) PyModule_FromDefAndSpec2(PyModuleDef *def,
 
 #endif /* New in 3.5 */
 
-#ifndef Py_LIMITED_API
-#  define Py_CPYTHON_MODSUPPORT_H
-#  include "cpython/modsupport.h"
-#  undef Py_CPYTHON_MODSUPPORT_H
-#endif
-
 #ifdef __cplusplus
 }
 #endif
index 4996c5c3094bc52f341a864c0b0280aa86a48d44..ff046ba09cc9f0c6f55a861324ca40dd7992dbf2 100644 (file)
@@ -1720,7 +1720,6 @@ PYTHON_HEADERS= \
                $(srcdir)/Include/cpython/longobject.h \
                $(srcdir)/Include/cpython/memoryobject.h \
                $(srcdir)/Include/cpython/methodobject.h \
-               $(srcdir)/Include/cpython/modsupport.h \
                $(srcdir)/Include/cpython/object.h \
                $(srcdir)/Include/cpython/objimpl.h \
                $(srcdir)/Include/cpython/odictobject.h \
diff --git a/Misc/NEWS.d/next/C API/2023-10-17-10-21-59.gh-issue-110964.OxqEjd.rst b/Misc/NEWS.d/next/C API/2023-10-17-10-21-59.gh-issue-110964.OxqEjd.rst
new file mode 100644 (file)
index 0000000..e45a25d
--- /dev/null
@@ -0,0 +1,2 @@
+Move the undocumented private _PyArg functions and _PyArg_Parser structure
+to internal C API (``pycore_modsupport.h``). Patch by Victor Stinner.
index e911286660b56e8d3e19a32f1755ab52299e7cd7..6d06208dd1d70d4ac253cf500bdeb95096f3248e 100644 (file)
@@ -4,6 +4,7 @@
 
 #include "Python.h"
 #include "pycore_dict.h"          // _PyDict_GetItem_KnownHash()
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 #include "pycore_moduleobject.h"  // _PyModule_GetState()
 #include "pycore_pyerrors.h"      // _PyErr_ClearExcState()
 #include "pycore_pylifecycle.h"   // _Py_IsInterpreterFinalizing()
index 869cbea78dd2674914adee4d88c2d4f4f2eef34d..79b6e672005503bc9f01e0f26c65bc9047abb234 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_long.h"          // _PyLong_UnsignedLong_Converter()
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(py_blake2b_new__doc__,
 "blake2b(data=b\'\', /, *, digest_size=_blake2.blake2b.MAX_DIGEST_SIZE,\n"
@@ -276,4 +277,4 @@ _blake2_blake2b_hexdigest(BLAKE2bObject *self, PyObject *Py_UNUSED(ignored))
 {
     return _blake2_blake2b_hexdigest_impl(self);
 }
-/*[clinic end generated code: output=2ad807e0c83d8c25 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=19b82b55c033d895 input=a9049054013a1b77]*/
index affc203486b1749900039d443b53be718a6da444..20446b335f82ede47fc7527a22cdf8f778fbf168 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_long.h"          // _PyLong_UnsignedLong_Converter()
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(py_blake2s_new__doc__,
 "blake2s(data=b\'\', /, *, digest_size=_blake2.blake2s.MAX_DIGEST_SIZE,\n"
@@ -276,4 +277,4 @@ _blake2_blake2s_hexdigest(BLAKE2sObject *self, PyObject *Py_UNUSED(ignored))
 {
     return _blake2_blake2s_hexdigest_impl(self);
 }
-/*[clinic end generated code: output=90ca2b52b8c40785 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=79b3479e90f4d077 input=a9049054013a1b77]*/
index 9568334b8069c8bc2df873d49c2857e13a3f8eea..714fbef08d22c98a7c5f13015ba00f9ce00060aa 100644 (file)
@@ -10,6 +10,11 @@ module instead.
 
 #define MODULE_VERSION "1.0"
 
+// clinic/_csv.c.h uses internal pycore_modsupport.h API
+#ifndef Py_BUILD_CORE_BUILTIN
+#  define Py_BUILD_CORE_MODULE 1
+#endif
+
 #include "Python.h"
 
 #include <stddef.h>               // offsetof()
index 184af2132c270782e0e3a4b9fa19159c8dcb5db4..3d2396713fbab6610698e2ae492f3dba9ec273b0 100644 (file)
@@ -110,6 +110,9 @@ bytes(cdata)
 
 #include "pycore_call.h"          // _PyObject_CallNoArgs()
 #include "pycore_ceval.h"         // _Py_EnterRecursiveCall()
+#ifdef MS_WIN32
+#  include "pycore_modsupport.h"  // _PyArg_NoKeywords()
+#endif
 #include "pycore_pyerrors.h"      // _PyErr_WriteUnraisableMsg()
 
 
index 292b57c083d0c8ea303f6e3ff8e904760b00953b..2ec8f34c5c220b0558100c1935160cb955ad9b35 100644 (file)
@@ -10,6 +10,11 @@ static const char PyCursesVersion[] = "2.1";
 
 /* Includes */
 
+// clinic/_curses_panel.c.h uses internal pycore_modsupport.h API
+#ifndef Py_BUILD_CORE_BUILTIN
+#  define Py_BUILD_CORE_MODULE 1
+#endif
+
 #include "Python.h"
 
 #include "py_curses.h"
index bd807698927e8659dd09a3d97085abb3d5d1d0ef..d50d2f1ef185970266564cd4dcc3262976f18c7c 100644 (file)
@@ -2,6 +2,11 @@
 /* DBM module using dictionary interface */
 
 
+// clinic/_dbmmodule.c.h uses internal pycore_modsupport.h API
+#ifndef Py_BUILD_CORE_BUILTIN
+#  define Py_BUILD_CORE_MODULE 1
+#endif
+
 #include "Python.h"
 
 #include <sys/types.h>
index eff36fd7fb669bcf777533991257f93d4af6d79a..db868c18160fdadc83509392c75cb2529257c86b 100644 (file)
@@ -1,8 +1,12 @@
-
 /* GDBM module using dictionary interface */
 /* Author: Anthony Baxter, after dbmmodule.c */
 /* Doc strings: Mitch Chapman */
 
+// clinic/_gdbmmodule.c.h uses internal pycore_modsupport.h API
+#ifndef Py_BUILD_CORE_BUILTIN
+#  define Py_BUILD_CORE_MODULE 1
+#endif
+
 #include "Python.h"
 #include "gdbm.h"
 
index 49a3573ab97473174dd89ef92e733ccd656acd5c..112408a95df036eccdf4c2b59e6050fadc048a6b 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(_io_open__doc__,
 "open($module, /, file, mode=\'r\', buffering=-1, encoding=None,\n"
@@ -403,4 +404,4 @@ _io_open_code(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=aaf96c8d9bd20abc input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5d60f4e778a600a4 input=a9049054013a1b77]*/
index 7577bdec5c3b2054c169cb21dac91a3989b05a7c..83c97ae42db00a271931f6ed91bcf15eecc27678 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _PyNumber_Index()
+#include "pycore_modsupport.h"    // _PyArg_BadArgument()
 
 PyDoc_STRVAR(_io__BufferedIOBase_readinto__doc__,
 "readinto($self, buffer, /)\n"
@@ -1094,4 +1095,4 @@ skip_optional_pos:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=f940cea085f0bf91 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b83f65fad0cd5fb6 input=a9049054013a1b77]*/
index d42ab48cef2859c79288942d65e1500457bd2aff..cf16335c9353007eb8024a8a6a22ef6ab2bc7a65 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _Py_convert_optional_to_ssize_t()
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 
 PyDoc_STRVAR(_io_BytesIO_readable__doc__,
 "readable($self, /)\n"
@@ -537,4 +538,4 @@ skip_optional_pos:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=b753fdf1ba36c461 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=27333725edff70a0 input=a9049054013a1b77]*/
index deb99fa9d99bd02dcddc6c7f6a6fc1010d6ebcc5..748bc9c644fbfe0f85f424dd5b407b5441ca2108 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _Py_convert_optional_to_ssize_t()
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(_io_FileIO_close__doc__,
 "close($self, /)\n"
@@ -535,4 +536,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=2ce6ce923ccef86e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=10838003d15e7b3d input=a9049054013a1b77]*/
index 9ac80b687925a4f0ab305cffc5ecff0784295b56..6bdfa1444015acc71f934574e2dee67177c085c7 100644 (file)
@@ -3,6 +3,7 @@ preserve
 [clinic start generated code]*/
 
 #include "pycore_abstract.h"      // _Py_convert_optional_to_ssize_t()
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(_io__IOBase_seek__doc__,
 "seek($self, offset, whence=os.SEEK_SET, /)\n"
@@ -437,4 +438,4 @@ _io__RawIOBase_readall(PyObject *self, PyObject *Py_UNUSED(ignored))
 {
     return _io__RawIOBase_readall_impl(self);
 }
-/*[clinic end generated code: output=95e1633805d10294 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5a22bc5db0ecaacb input=a9049054013a1b77]*/
index ccdae18d2af24a881a9d4a4cc478c8d70f29a23b..571ec5117147d5798b0de2bbcc448a8ff4839bc9 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _Py_convert_optional_to_ssize_t()
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 
 PyDoc_STRVAR(_io_StringIO_getvalue__doc__,
 "getvalue($self, /)\n"
@@ -367,4 +368,4 @@ _io_StringIO_seekable(stringio *self, PyObject *Py_UNUSED(ignored))
 {
     return _io_StringIO_seekable_impl(self);
 }
-/*[clinic end generated code: output=57e86cd679344ee7 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f56aa7f8a271acf6 input=a9049054013a1b77]*/
index bc14327388fb2ff8191307bb219d059848b63155..b24a1669f9b34417779e49326665ae2639b06a48 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _Py_convert_optional_to_ssize_t()
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(_io__TextIOBase_detach__doc__,
 "detach($self, /)\n"
@@ -979,4 +980,4 @@ _io_TextIOWrapper_close(textio *self, PyObject *Py_UNUSED(ignored))
 {
     return _io_TextIOWrapper_close_impl(self);
 }
-/*[clinic end generated code: output=175e1723a462a722 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=e58ce89b7354e77a input=a9049054013a1b77]*/
index ecc71e552c23f43d1a578181c7deceffd70fa5df..f40786a96caf725b52b507bfcaa87c23d6191f12 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _Py_convert_optional_to_ssize_t()
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 #if defined(HAVE_WINDOWS_CONSOLE_IO)
 
@@ -464,4 +465,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=37febc4c96732b3b input=a9049054013a1b77]*/
+/*[clinic end generated code: output=2debef253fa1ab90 input=a9049054013a1b77]*/
index 0ae0039a666061b61d3471b1bb31bb585204007b..70cdeef4821b33c770cfba942e5170acb0121353 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 #if defined(MS_WINDOWS)
 
 PyDoc_STRVAR(_multiprocessing_closesocket__doc__,
@@ -166,4 +168,4 @@ exit:
 #ifndef _MULTIPROCESSING_SEND_METHODDEF
     #define _MULTIPROCESSING_SEND_METHODDEF
 #endif /* !defined(_MULTIPROCESSING_SEND_METHODDEF) */
-/*[clinic end generated code: output=8b91c020d4353cc5 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=48504f7a2d37958c input=a9049054013a1b77]*/
index 09dfa11da23b86bdb84ad4739c99365423307acf..6b6a9b11c0d990c53a36329e37d965bd5fa2a98d 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 #if defined(HAVE_SHM_OPEN)
 
@@ -165,4 +166,4 @@ exit:
 #ifndef _POSIXSHMEM_SHM_UNLINK_METHODDEF
     #define _POSIXSHMEM_SHM_UNLINK_METHODDEF
 #endif /* !defined(_POSIXSHMEM_SHM_UNLINK_METHODDEF) */
-/*[clinic end generated code: output=2f356903a281d857 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b525631f5915d7f3 input=a9049054013a1b77]*/
index a4357376ee1292740e315a0942aae5f9c9ff157e..7c855113113c20e771e5de948b53e84614b4e42c 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 #if defined(HAVE_MP_SEMAPHORE) && defined(MS_WINDOWS)
 
@@ -541,4 +542,4 @@ exit:
 #ifndef _MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF
     #define _MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF
 #endif /* !defined(_MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF) */
-/*[clinic end generated code: output=e8ea65f8cba8e173 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d57992037e6770b6 input=a9049054013a1b77]*/
index debef3267f77d1f5ff07d3b971e7fbc2d9d0fabd..f4da9f7ceba69836490a8ce47dc3c6d04c5ead00 100644 (file)
@@ -2,6 +2,11 @@
 posixshmem - A Python extension that provides shm_open() and shm_unlink()
 */
 
+// clinic/posixshmem.c.h uses internal pycore_modsupport.h API
+#ifndef Py_BUILD_CORE_BUILTIN
+#  define Py_BUILD_CORE_MODULE 1
+#endif
+
 #include <Python.h>
 
 // for shm_open() and shm_unlink()
index d41093c88064767e9fd2c3088be08b82b41a2200..7a220e2f3d54588ff37ba972b46fdfbb7d951fb6 100644 (file)
@@ -72,6 +72,7 @@
 
 #include "Python.h"
 #include "pycore_long.h"          // _PyLong_AsByteArray()
+#include "pycore_modsupport.h"    // _PyArg_NoKeywords()
 #include "pycore_moduleobject.h"  // _PyModule_GetState()
 #include "pycore_pylifecycle.h"   // _PyOS_URandomNonblock()
 
index eceb5a7bf23673617301eefb8303c1c2a3dd9b0e..1bcda7702c2568a994859ba64884828f47a1716a 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(pysqlite_connect__doc__,
 "connect($module, /, database, timeout=5.0, detect_types=0,\n"
@@ -27,4 +28,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=03bd99542e3aec9d input=a9049054013a1b77]*/
+/*[clinic end generated code: output=69b9b00da71c3c0a input=a9049054013a1b77]*/
index e7c60264722f7b74c7c91502d795e4d70b14bf7d..2c63817322214088ff055afdd73eaf05f721f3a0 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(blob_close__doc__,
 "close($self, /)\n"
 "--\n"
@@ -213,4 +215,4 @@ blob_exit(pysqlite_Blob *self, PyObject *const *args, Py_ssize_t nargs)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=8bfd79ab12ac5385 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=27c24afc687bd772 input=a9049054013a1b77]*/
index fcc657799dfaf0ca4bae756f0958a14275b9ced6..46761cddd891e155b5c9bcdb033d71e37497db5d 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 static int
 pysqlite_connection_init_impl(pysqlite_Connection *self, PyObject *database,
@@ -1821,4 +1822,4 @@ exit:
 #ifndef DESERIALIZE_METHODDEF
     #define DESERIALIZE_METHODDEF
 #endif /* !defined(DESERIALIZE_METHODDEF) */
-/*[clinic end generated code: output=166bf41ad5ca1655 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b9c27a406e329587 input=a9049054013a1b77]*/
index 3cb637bde4ff6c3a33bd268b2c4b6b3c8e5bac39..a13e0d0745b58ddd955966ec1690aa9b1d744837 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 
 static int
 pysqlite_cursor_init_impl(pysqlite_Cursor *self,
@@ -312,4 +313,4 @@ pysqlite_cursor_close(pysqlite_Cursor *self, PyObject *Py_UNUSED(ignored))
 {
     return pysqlite_cursor_close_impl(self);
 }
-/*[clinic end generated code: output=0c52a9cf54d00543 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a8ce095c3c80cf65 input=a9049054013a1b77]*/
index 49ba7a341ed58753fd70cefcc97074447694339b..529dc4e281e0eb5a5ba01694a7552a5d37cec34e 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(pysqlite_complete_statement__doc__,
 "complete_statement($module, /, statement)\n"
@@ -207,4 +208,4 @@ skip_optional:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=a14893a7c2eead5e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=457ab0fdbb9e1880 input=a9049054013a1b77]*/
index cdf850d01e01a325f2ee306d135891c182634c68..e8d1dbf2ba8bc9710dab43fb9e7f85c618451c4b 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 static PyObject *
 pysqlite_row_new_impl(PyTypeObject *type, pysqlite_Cursor *cursor,
                       PyObject *data);
@@ -54,4 +56,4 @@ pysqlite_row_keys(pysqlite_Row *self, PyObject *Py_UNUSED(ignored))
 {
     return pysqlite_row_keys_impl(self);
 }
-/*[clinic end generated code: output=972487d535d2e7d5 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=788bf817acc02b8e input=a9049054013a1b77]*/
index 21bdbc12814698bbb9803c1118e604b0bff8d809..319ed0c29c7a9b617c7d91ee4efc988b635df13e 100644 (file)
@@ -35,6 +35,7 @@
 #include "util.h"
 
 #include "pycore_import.h"        // _PyImport_GetModuleAttrString()
+#include "pycore_modsupport.h"    // _PyArg_NoKeywords()
 #include "pycore_pyerrors.h"      // _PyErr_ChainExceptions1()
 #include "pycore_pylifecycle.h"   // _Py_IsInterpreterFinalizing()
 #include "pycore_weakref.h"       // _PyWeakref_IS_DEAD()
index 1a1943285ce008fc7eda286af5819fdcf8a94065..14555076a7e79a0875687b807602368b17143ebf 100644 (file)
  * 3. This notice may not be removed or altered from any source distribution.
  */
 
+#ifndef Py_BUILD_CORE_BUILTIN
+#  define Py_BUILD_CORE_MODULE 1
+#endif
+
 #include "row.h"
 #include "cursor.h"
 
index 1b5e1a710af9db713450d62b220dfa7846fccca0..cd3fbbc720bdf1ece70ba5ae1b082a30ca08540d 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _PyNumber_Index()
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(_sre_getcodesize__doc__,
 "getcodesize($module, /)\n"
@@ -1460,4 +1461,4 @@ _sre_SRE_Scanner_search(ScannerObject *self, PyTypeObject *cls, PyObject *const
     }
     return _sre_SRE_Scanner_search_impl(self, cls);
 }
-/*[clinic end generated code: output=46d83927cbafa93a input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ad513f31b99505fa input=a9049054013a1b77]*/
index db43c88e4111397465d017bf6bb3384078669a3f..0748d32291e3c5ea6c9e8b35234511d35c189b43 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(_ssl_Certificate_public_bytes__doc__,
 "public_bytes($self, /, format=Encoding.PEM)\n"
@@ -85,4 +86,4 @@ _ssl_Certificate_get_info(PySSLCertificate *self, PyObject *Py_UNUSED(ignored))
 {
     return _ssl_Certificate_get_info_impl(self);
 }
-/*[clinic end generated code: output=8e438b54fbebd53e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5b668226f933a677 input=a9049054013a1b77]*/
index 1d5465fbe6d04ebcb88adb9bce98c3a3725afb9f..a04a2a779a5d3d32efd3c8a60e1dcdc3831b8681 100644 (file)
@@ -1,5 +1,10 @@
 /* statistics accelerator C extension: _statistics module. */
 
+// clinic/_statisticsmodule.c.h uses internal pycore_modsupport.h API
+#ifndef Py_BUILD_CORE_BUILTIN
+#  define Py_BUILD_CORE_MODULE 1
+#endif
+
 #include "Python.h"
 #include "clinic/_statisticsmodule.c.h"
 
index 39b5f8b91a00db0d93de7c1d2155c758a23b5d14..a797444c1a72b985431d069f37cd6559ef6ae69c 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 
 PyDoc_STRVAR(_testcapi_err_set_raised__doc__,
 "err_set_raised($module, exception, /)\n"
@@ -455,4 +456,4 @@ _testcapi_unstable_exc_prep_reraise_star(PyObject *module, PyObject *const *args
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=ff19512450b3bbdb input=a9049054013a1b77]*/
+/*[clinic end generated code: output=0b11ef105030a48e input=a9049054013a1b77]*/
index fb0931a0703e11bddf69fa87ae744de51c08acb7..d5a00c8072da1ef38da075cc54a9f7b612e1ee92 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(_testcapi_float_pack__doc__,
 "float_pack($module, size, d, le, /)\n"
 "--\n"
@@ -79,4 +81,4 @@ _testcapi_float_unpack(PyObject *module, PyObject *const *args, Py_ssize_t nargs
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=50146051f1341cce input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b43dfd3a77fe04ba input=a9049054013a1b77]*/
index 48688e9ade050a89460b70ec686878e19e83ae3b..c6049a438dc8fcc7f1d57f88bf1bbc04fdb52d4a 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(_testcapi_pyobject_fastcalldict__doc__,
 "pyobject_fastcalldict($module, func, func_args, kwargs, /)\n"
 "--\n"
@@ -204,4 +206,4 @@ _testcapi_has_vectorcall_flag(PyObject *module, PyObject *arg)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=0667266b825ec9ec input=a9049054013a1b77]*/
+/*[clinic end generated code: output=210ae67caab177ba input=a9049054013a1b77]*/
index fd2ef60833404957b0eb28a90231fa4f128924f4..ebd71d119fa3474deaf92a1a605aa3f6b80d7180 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(_testcapi_watch_dict__doc__,
 "watch_dict($module, watcher_id, dict, /)\n"
 "--\n"
@@ -189,4 +191,4 @@ _testcapi_set_func_kwdefaults_via_capi(PyObject *module, PyObject *const *args,
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=5ad5771d6b29dfb9 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=0e07ce7f295917a5 input=a9049054013a1b77]*/
index b54ce0cbb0dd206db956fdce7f992abe78bfe4d7..e463e6237099fea52bf58510bbb03e0a836ea641 100644 (file)
@@ -1,3 +1,6 @@
+// clinic/exceptions.c.h uses internal pycore_modsupport.h API
+#define PYTESTCAPI_NEED_INTERNAL_API
+
 #include "parts.h"
 #include "util.h"
 #include "clinic/exceptions.c.h"
index cff53fb950fcc6067bd6367715252e58f000acbe..2a7d9799ae8bd15ea8ac7cb814f8376007493761 100644 (file)
@@ -1,3 +1,6 @@
+// clinic/float.c.h uses internal pycore_modsupport.h API
+#define PYTESTCAPI_NEED_INTERNAL_API
+
 #include "parts.h"
 #include "clinic/float.c.h"
 
index acdba86504f58efdd55c26c5cd8d51026795d829..e5dbb9cc49ff4bcc494aa6b2c51b363b8a085def 100644 (file)
@@ -4,21 +4,27 @@
 // Always enable assertions
 #undef NDEBUG
 
-// The _testcapi extension tests the public C API: header files in Include/ and
-// Include/cpython/ directories. The internal C API must not be tested by
-// _testcapi: use _testinternalcapi for that.
-//
-// _testcapi C files can built with the Py_BUILD_CORE_BUILTIN macro defined if
-// one of the Modules/Setup files asks to build _testcapi as "static"
-// (gh-109723).
-//
-// The Visual Studio projects builds _testcapi with Py_BUILD_CORE_MODULE.
-#undef Py_BUILD_CORE_MODULE
-#undef Py_BUILD_CORE_BUILTIN
+#ifdef PYTESTCAPI_NEED_INTERNAL_API
+#  ifndef Py_BUILD_CORE_BUILTIN
+#    define Py_BUILD_CORE_MODULE 1
+#  endif
+#else
+   // The _testcapi extension tests the public C API: header files in Include/
+   // and Include/cpython/ directories. The internal C API must not be tested
+   // by _testcapi: use _testinternalcapi for that.
+   //
+   // _testcapi C files can built with the Py_BUILD_CORE_BUILTIN macro defined
+   // if one of the Modules/Setup files asks to build _testcapi as "static"
+   // (gh-109723).
+   //
+   // The Visual Studio projects builds _testcapi with Py_BUILD_CORE_MODULE.
+#  undef Py_BUILD_CORE_MODULE
+#  undef Py_BUILD_CORE_BUILTIN
+#endif
 
 #include "Python.h"
 
-#ifdef Py_BUILD_CORE
+#if defined(Py_BUILD_CORE) && !defined(PYTESTCAPI_NEED_INTERNAL_API)
 #  error "_testcapi must test the public Python C API, not the internal C API"
 #endif
 
index 2b5110fcba2c91faa64e7737a9f3b197395afaa0..b30c5e8704c8af46fe3e2c6d760b9b627fd33d8d 100644 (file)
@@ -1,3 +1,6 @@
+// clinic/vectorcall.c.h uses internal pycore_modsupport.h API
+#define PYTESTCAPI_NEED_INTERNAL_API
+
 #include "parts.h"
 #include "clinic/vectorcall.c.h"
 
index 8a264bba4ed6ed2d83c3b9385f83a1713cbcacd0..a763ff46a3c2901f5ff912fb589078251b5b71aa 100644 (file)
@@ -1,3 +1,6 @@
+// clinic/watchers.c.h uses internal pycore_modsupport.h API
+#define PYTESTCAPI_NEED_INTERNAL_API
+
 #include "parts.h"
 
 #include "clinic/watchers.c.h"
index c6a8dda58f6c22125785dd9ec8d397b500d6e76a..577fea35d97b7ee5af434224d9287c4ddc9f42e5 100644 (file)
@@ -2023,10 +2023,10 @@ test_pythread_tss_key_state(PyObject *self, PyObject *args)
        return repr(self)
 */
 static PyObject*
-bad_get(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+bad_get(PyObject *module, PyObject *args)
 {
     PyObject *self, *obj, *cls;
-    if (!_PyArg_UnpackStack(args, nargs, "bad_get", 3, 3, &self, &obj, &cls)) {
+    if (!PyArg_ParseTuple(args, "OOO", &self, &obj, &cls)) {
         return NULL;
     }
 
@@ -3340,7 +3340,7 @@ static PyMethodDef TestMethods[] = {
     {"W_STOPCODE", py_w_stopcode, METH_VARARGS},
 #endif
     {"test_pythread_tss_key_state", test_pythread_tss_key_state, METH_VARARGS},
-    {"bad_get", _PyCFunction_CAST(bad_get), METH_FASTCALL},
+    {"bad_get", bad_get, METH_VARARGS},
 #ifdef Py_REF_DEBUG
     {"negative_refcount", negative_refcount, METH_NOARGS},
     {"decref_freed_object", decref_freed_object, METH_NOARGS},
index 3cbe5ef12c5fa619b6ef5d61b873fd6b72919161..86875767343cd236834aa4b08c86a1f5f43c47d4 100644 (file)
@@ -3,6 +3,7 @@ preserve
 [clinic start generated code]*/
 
 #include "pycore_abstract.h"      // _PyNumber_Index()
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 
 PyDoc_STRVAR(_testinternalcapi_benchmark_locks__doc__,
 "benchmark_locks($module, num_threads, use_pymutex=True,\n"
@@ -71,4 +72,4 @@ skip_optional:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=97c85dff601fed4b input=a9049054013a1b77]*/
+/*[clinic end generated code: output=105105d759c0c271 input=a9049054013a1b77]*/
index fdef06168bfc86b0997aac1ea4cef2ce79b1a12a..21c5f696a4f2ec4692ec39982dbb8eb1a07520e6 100644 (file)
@@ -6,6 +6,7 @@
 #endif
 
 #include "Python.h"
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 #include "pycore_namespace.h"     // _PyNamespace_New()
 
 /* State for testing module state access from methods */
index 12c98ea61fb7acb69e3bb293ed734b32d7eac779..69078dc74d5c373a64a34175c96253ab8be57f25 100644 (file)
@@ -7,8 +7,10 @@
 
 #include "Python.h"
 #include "pycore_initconfig.h"    // _PyErr_SetFromPyStatus()
+#include "pycore_modsupport.h"    // _PyArg_BadArgument()
 #include "pycore_pyerrors.h"      // _PyErr_ChainExceptions1()
 #include "pycore_pystate.h"       // _PyInterpreterState_SetRunningMain()
+
 #include "interpreteridobject.h"
 #include "marshal.h"              // PyMarshal_ReadObjectFromString()
 
index 309a36919f346500577ec2c898d25ae0d09754b8..cf74690f41288c235f2acb1a14e44107e0d2f59d 100644 (file)
@@ -12,6 +12,7 @@
 #include "pycore_call.h"          // _PyObject_CallMethod()
 #include "pycore_ceval.h"         // _PyEval_GetBuiltin()
 #include "pycore_long.h"          // _PyLong_FromByteArray()
+#include "pycore_modsupport.h"    // _PyArg_NoKeywords()
 #include "pycore_moduleobject.h"  // _PyModule_GetState()
 
 #include <stddef.h>               // offsetof()
index 0b73a7059eb5847e959fa6ea09e256c866636e56..4f2b91f3b19b16196008ca6709cee97487c53213 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(_multibytecodec_MultibyteCodec_encode__doc__,
 "encode($self, /, input, errors=None)\n"
@@ -689,4 +690,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=1ee928e7a85e9d34 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=38f8d42721eea1e6 input=a9049054013a1b77]*/
index 8d3832e1b83d2d39a57c4dff5225377b3fed4e27..04681fa2206a2a543c5076e454f4b263fe775e9a 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(_abc__reset_registry__doc__,
 "_reset_registry($module, self, /)\n"
 "--\n"
@@ -159,4 +161,4 @@ _abc_get_cache_token(PyObject *module, PyObject *Py_UNUSED(ignored))
 {
     return _abc_get_cache_token_impl(module);
 }
-/*[clinic end generated code: output=babb3ce445fa9b21 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=1989b6716c950e17 input=a9049054013a1b77]*/
index 74dd06461e6e27f049cd5e4a398ee7e80bac1bfd..d941c280a4300ba4d81163b73dc9c608c479bbbb 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(_asyncio_Future___init____doc__,
 "Future(*, loop=None)\n"
@@ -1486,4 +1487,4 @@ skip_optional_pos:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=1b7658bfab7024f3 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f3864d8e2af7635f input=a9049054013a1b77]*/
index 5553b05acbf5210f4ad4bf825a1ac563c1f34a36..9955d0edb2699ff3ad7a6053fd4ec458b76a6ed0 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _PyNumber_Index()
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(_bisect_bisect_right__doc__,
 "bisect_right($module, /, a, x, lo=0, hi=None, *, key=None)\n"
@@ -433,4 +434,4 @@ skip_optional_kwonly:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=43ece163c3e972df input=a9049054013a1b77]*/
+/*[clinic end generated code: output=4af5bd405149bf5f input=a9049054013a1b77]*/
index 29f5d3a68e06ae44380f123a821739a9d349460a..b665c01f1a9ff98146754d30aa273c17db10b0ed 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _PyNumber_Index()
+#include "pycore_modsupport.h"    // _PyArg_BadArgument()
 
 PyDoc_STRVAR(_bz2_BZ2Compressor_compress__doc__,
 "compress($self, data, /)\n"
@@ -241,4 +242,4 @@ _bz2_BZ2Decompressor(PyTypeObject *type, PyObject *args, PyObject *kwargs)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=3dfc8436fa8eaefb input=a9049054013a1b77]*/
+/*[clinic end generated code: output=90f7b5c451c0a8bf input=a9049054013a1b77]*/
index bf9bd4a61f5ce42dc7357c9258d4c3c4a4b24aa4..d69b6824fb70740b4c00b3d237995c23e7c60820 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_BadArgument()
 
 PyDoc_STRVAR(_codecs_register__doc__,
 "register($module, search_function, /)\n"
@@ -2817,4 +2818,4 @@ exit:
 #ifndef _CODECS_CODE_PAGE_ENCODE_METHODDEF
     #define _CODECS_CODE_PAGE_ENCODE_METHODDEF
 #endif /* !defined(_CODECS_CODE_PAGE_ENCODE_METHODDEF) */
-/*[clinic end generated code: output=3473564544f10403 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=40cf63bf2da18359 input=a9049054013a1b77]*/
index a375b87261ce2db8d66cceed074cb45c6cd14669..591ab50c76a8e8f629e5ebfbbbdd2fe22426cc9c 100644 (file)
@@ -3,6 +3,7 @@ preserve
 [clinic start generated code]*/
 
 #include "pycore_abstract.h"      // _PyNumber_Index()
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 
 PyDoc_STRVAR(_collections__count_elements__doc__,
 "_count_elements($module, mapping, iterable, /)\n"
@@ -71,4 +72,4 @@ tuplegetter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=b01ddb9fdecc4a2d input=a9049054013a1b77]*/
+/*[clinic end generated code: output=c896a72f8c45930d input=a9049054013a1b77]*/
index 86ed0efd79028e25933ac44abf060b4145d9c295..2442bdcde5679fa21e587c4e208e2e554c3fa8ce 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(_csv_list_dialects__doc__,
 "list_dialects($module, /)\n"
@@ -205,4 +206,4 @@ skip_optional_pos:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=4704d708f5745e91 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=9ec59717f5414d8b input=a9049054013a1b77]*/
index a8c32c6aa3fc1054c4e380471196ca706063268b..7945d93b5433f7d45155239434aa860bd7561fd1 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
+
 PyDoc_STRVAR(_curses_panel_panel_bottom__doc__,
 "bottom($self, /)\n"
 "--\n"
@@ -416,4 +418,4 @@ _curses_panel_update_panels(PyObject *module, PyObject *Py_UNUSED(ignored))
 {
     return _curses_panel_update_panels_impl(module);
 }
-/*[clinic end generated code: output=dd302cb9afc42f40 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=636beecf71d96ff1 input=a9049054013a1b77]*/
index ecc3c059d03c901bfea332e9f94731cc44b6a319..dd9f1ab6841d0140008deabebbeea56696fef8d0 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 
 PyDoc_STRVAR(_curses_window_addch__doc__,
 "addch([y, x,] ch, [attr=_curses.A_NORMAL])\n"
@@ -4312,4 +4313,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=839faafb638935ea input=a9049054013a1b77]*/
+/*[clinic end generated code: output=24ad16254d1eef9c input=a9049054013a1b77]*/
index 177a37e486e24da5d2ab7b77110deb419a0c50ed..1ee50fc2a1376218ba75f6005bc1d1fb163fc5e8 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(datetime_date_fromtimestamp__doc__,
 "fromtimestamp($type, timestamp, /)\n"
@@ -145,4 +146,4 @@ skip_optional_pos:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=e422c25b1c28f38b input=a9049054013a1b77]*/
+/*[clinic end generated code: output=562813dd3e164794 input=a9049054013a1b77]*/
index a76b8b30eded39cb2e7742c46506243035639d19..5a4aba2825e03a60a85f9adb03cc9ae0625700e3 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
+
 PyDoc_STRVAR(_dbm_dbm_close__doc__,
 "close($self, /)\n"
 "--\n"
@@ -216,4 +218,4 @@ skip_optional:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=972d221f9da819d3 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=96fdd4bd7bd256c5 input=a9049054013a1b77]*/
index 3477257f9d2cf2ff726f67642ea35e1a3d4aa9bc..02375c8a61e73e4bc33d0939c47f979c558d65cf 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _PyNumber_Index()
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(_elementtree_Element_append__doc__,
 "append($self, subelement, /)\n"
@@ -1218,4 +1219,4 @@ skip_optional:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=20d1869da79a43d7 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=8fdaa17d3262800a input=a9049054013a1b77]*/
index 25a3e5b0da60a8378d866b05141a61c572a4a81e..94f7a23e8f217a756dbec3deb7af906905982dd3 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(_functools_cmp_to_key__doc__,
 "cmp_to_key($module, /, mycmp)\n"
@@ -100,4 +101,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=de9cf85e85167f43 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=231403340a20e31b input=a9049054013a1b77]*/
index e9138bbf0430c5c4ffbc86085687b2798e90633e..c7164e519d0e7deaa80c035d8133119108eb3009 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(_gdbm_gdbm_get__doc__,
 "get($self, key, default=None, /)\n"
 "--\n"
@@ -338,4 +340,4 @@ skip_optional:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=84f30c7fff0eadac input=a9049054013a1b77]*/
+/*[clinic end generated code: output=c5ee922363d5a81f input=a9049054013a1b77]*/
index e41f608bde50112210dca04ed9c1974771a5cbb4..dc28aaca1f7e07a2cf6e29d654a7ac53f4cf6cf9 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _PyNumber_Index()
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(EVP_copy__doc__,
 "copy($self, /)\n"
@@ -1851,4 +1852,4 @@ exit:
 #ifndef _HASHLIB_SCRYPT_METHODDEF
     #define _HASHLIB_SCRYPT_METHODDEF
 #endif /* !defined(_HASHLIB_SCRYPT_METHODDEF) */
-/*[clinic end generated code: output=75413752099f2dec input=a9049054013a1b77]*/
+/*[clinic end generated code: output=21ad88d46922dc00 input=a9049054013a1b77]*/
index 8d73b5b48d6a0ec5db59bcbba3537dc80b5fece3..9046307990773ba6add1a12aabe9ea5419602e3e 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(_heapq_heappush__doc__,
 "heappush($module, heap, item, /)\n"
 "--\n"
@@ -265,4 +267,4 @@ _heapq__heapify_max(PyObject *module, PyObject *arg)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=9a22715a8bf0c91d input=a9049054013a1b77]*/
+/*[clinic end generated code: output=05f2afdf3bc54c9d input=a9049054013a1b77]*/
index efbb9f709958cd6b1b8ad3708624564d7ccd7f88..5e0880b0d0bb4c0c1420f3da7cdc73cac541e1b0 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(_locale_setlocale__doc__,
 "setlocale($module, category, locale=<unrepresentable>, /)\n"
 "--\n"
@@ -593,4 +595,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=3abe7fade999eff6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=034a3c219466d207 input=a9049054013a1b77]*/
index 528b48384f0bcbe56ef4e8eb4272de5413964d73..1079b409a6b6d0eea78339fa1489dc0dc1b4c8de 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _PyNumber_Index()
+#include "pycore_modsupport.h"    // _PyArg_BadArgument()
 
 PyDoc_STRVAR(_lzma_LZMACompressor_compress__doc__,
 "compress($self, data, /)\n"
@@ -338,4 +339,4 @@ exit:
 
     return return_value;
 }
-/*[clinic end generated code: output=eadc9ee7a11a06f5 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=fca7d2b5800dc4c1 input=a9049054013a1b77]*/
index 4b9a70d2ba98520c204518933a3fe25ffb9f6448..c7fd0f9f8a742067105baf5843db4bdbf29fc248 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(_opcode_stack_effect__doc__,
 "stack_effect($module, opcode, oparg=None, /, *, jump=None)\n"
@@ -667,4 +668,4 @@ _opcode_get_intrinsic2_descs(PyObject *module, PyObject *Py_UNUSED(ignored))
 {
     return _opcode_get_intrinsic2_descs_impl(module);
 }
-/*[clinic end generated code: output=d608239a4c7a05a1 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a1052bb1deffb7f2 input=a9049054013a1b77]*/
index 06bde243b4e85bf2c83f38fefab8ae4e2b7c380f..08615d690922a1c133311ef4d23e1c03f4466502 100644 (file)
@@ -3,6 +3,7 @@ preserve
 [clinic start generated code]*/
 
 #include "pycore_abstract.h"      // _PyNumber_Index()
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 
 PyDoc_STRVAR(_operator_truth__doc__,
 "truth($module, a, /)\n"
@@ -1488,4 +1489,4 @@ _operator__compare_digest(PyObject *module, PyObject *const *args, Py_ssize_t na
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=9658aca50a9ad991 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ddbba2cd943571eb input=a9049054013a1b77]*/
index 5df40d628277541f1f0bad8a6673a23acda925e1..932ace190e60596435611f2eacbd51554fcb81b6 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(_pickle_Pickler_clear_memo__doc__,
 "clear_memo($self, /)\n"
@@ -1033,4 +1034,4 @@ skip_optional_kwonly:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=57c209a12264146d input=a9049054013a1b77]*/
+/*[clinic end generated code: output=7f0564b5fb5410a8 input=a9049054013a1b77]*/
index 83048a385d319cfbb1e30a671758c9023414b16d..dd7644de6b7534fbbc3015d3d644e5d724be5974 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 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"
@@ -153,4 +155,4 @@ subprocess_fork_exec(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=a83b11467169b97b input=a9049054013a1b77]*/
+/*[clinic end generated code: output=48555f5965a871be input=a9049054013a1b77]*/
index 8d4df14ae3b00909b967f86d8e268c286d16b4b8..8e2a430835e35f719c9b95511924da6d53a52348 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_NoKeywords()
 
 PyDoc_STRVAR(simplequeue_new__doc__,
 "SimpleQueue()\n"
@@ -330,4 +331,4 @@ _queue_SimpleQueue_qsize(simplequeueobject *self, PyObject *Py_UNUSED(ignored))
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=5c326e4c1f2a1ad7 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=457310b20cb61cf8 input=a9049054013a1b77]*/
index 008b531d832c5add8c792bd502c72d32efbe9cda..757e49e23cacfb2fc110b5cbc28a8a797135dde2 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(_random_Random_random__doc__,
 "random($self, /)\n"
 "--\n"
@@ -109,4 +111,4 @@ _random_Random_getrandbits(RandomObject *self, PyObject *arg)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=5e7e05d756a7e1c7 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5c800a28c2d7b9d1 input=a9049054013a1b77]*/
index 5f8ae29180a4fae5764880f7acca52e27a44121b..bc692518e5448c5ad8fcf2f0ba0a8c0d0ad380f7 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _PyNumber_Index()
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 
 PyDoc_STRVAR(_ssl__SSLSocket_do_handshake__doc__,
 "do_handshake($self, /)\n"
@@ -1542,4 +1543,4 @@ exit:
 #ifndef _SSL_ENUM_CRLS_METHODDEF
     #define _SSL_ENUM_CRLS_METHODDEF
 #endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */
-/*[clinic end generated code: output=a47d575abe0aceb6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f15635b2faa3b2db input=a9049054013a1b77]*/
index 03543e41af7f5a0fb36420a8a7e84bcbcf12823c..653a2138aaad7043ef3b7d7f8a929b888b2aafa3 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(_statistics__normal_dist_inv_cdf__doc__,
 "_normal_dist_inv_cdf($module, p, mu, sigma, /)\n"
 "--\n"
@@ -65,4 +67,4 @@ _statistics__normal_dist_inv_cdf(PyObject *module, PyObject *const *args, Py_ssi
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=b807a8243e7801e6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=e7cead17f9f3e19f input=a9049054013a1b77]*/
index 8c468e6e7205e69fb29edb5464df1a21656f12bb..45d90710c548659154d3eac42cdb9def4daa5a6d 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _PyNumber_Index()
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(Struct__doc__,
 "Struct(format)\n"
@@ -451,4 +452,4 @@ exit:
 
     return return_value;
 }
-/*[clinic end generated code: output=5c1bc384ff87df1f input=a9049054013a1b77]*/
+/*[clinic end generated code: output=1749aaf639d5c11c input=a9049054013a1b77]*/
index 3655e82150d4011932e20342f74df055749691ee..fea30e778381dea09e2a1cf09b17cb63f11d002a 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #endif
 #include "pycore_abstract.h"      // _PyNumber_Index()
 #include "pycore_long.h"          // _PyLong_UnsignedShort_Converter()
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 #include "pycore_runtime.h"       // _Py_ID()
 
 PyDoc_STRVAR(test_empty_function__doc__,
@@ -3140,4 +3141,4 @@ skip_optional_pos:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=aea5f282f24761aa input=a9049054013a1b77]*/
+/*[clinic end generated code: output=90743ac900d60f9f input=a9049054013a1b77]*/
index 36ff55bc0029399d45746428f1510977e0d62623..732c38104083994298ddb58eab3f6639d17b7690 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #endif
 #include "pycore_abstract.h"      // _PyNumber_Index()
 #include "pycore_long.h"          // _PyLong_UnsignedShort_Converter()
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 #include "pycore_runtime.h"       // _Py_ID()
 
 PyDoc_STRVAR(depr_star_new__doc__,
@@ -2392,4 +2393,4 @@ depr_multi(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=689b1e2d0872e413 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=2c19d1804ba6e53b input=a9049054013a1b77]*/
index c1b42672e13d535eb1711447c8de3c5f1b681cc6..10374e0211ff03692def4d705fd9e6ac8a446d4e 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(_testinternalcapi_compiler_cleandoc__doc__,
 "compiler_cleandoc($module, /, doc)\n"
@@ -313,4 +314,4 @@ _testinternalcapi_test_long_numbits(PyObject *module, PyObject *Py_UNUSED(ignore
 {
     return _testinternalcapi_test_long_numbits_impl(module);
 }
-/*[clinic end generated code: output=59144f59957627bd input=a9049054013a1b77]*/
+/*[clinic end generated code: output=3425f97821fc7462 input=a9049054013a1b77]*/
index a96d20bf33ea03430767ec65ae5438a30c3d617a..c0a00954c16cbe277389a524acd2eab53bf1b401 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(_testmultiphase_StateAccessType_get_defining_module__doc__,
 "get_defining_module($self, /)\n"
@@ -161,4 +162,4 @@ _testmultiphase_StateAccessType_get_count(StateAccessTypeObject *self, PyTypeObj
     }
     return _testmultiphase_StateAccessType_get_count_impl(self, cls);
 }
-/*[clinic end generated code: output=db1fdd15244ee59c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d8c262af27b3b98d input=a9049054013a1b77]*/
index fcfc406238808be9700790f6d56059d26a443f87..188bcc773cfc41cc863c8003219dd921956c362f 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_BadArgument()
+
 PyDoc_STRVAR(_tkinter_tkapp_eval__doc__,
 "eval($self, script, /)\n"
 "--\n"
@@ -859,4 +861,4 @@ exit:
 #ifndef _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF
     #define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF
 #endif /* !defined(_TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF) */
-/*[clinic end generated code: output=bcd9cdc8f6bdcfae input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d447501ec5aa9447 input=a9049054013a1b77]*/
index c07ad797d6295bbd69055576f21bf4f501eee877..1d10024742399180668ac8b76fea6f137377ae2b 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(_tracemalloc_is_tracing__doc__,
 "is_tracing($module, /)\n"
 "--\n"
@@ -212,4 +214,4 @@ _tracemalloc_reset_peak(PyObject *module, PyObject *Py_UNUSED(ignored))
 {
     return _tracemalloc_reset_peak_impl(module);
 }
-/*[clinic end generated code: output=ad7d1fae89f2bdaa input=a9049054013a1b77]*/
+/*[clinic end generated code: output=9d4d884b156c2ddb input=a9049054013a1b77]*/
index 541cba75e6813c8c2ea8ebefc390ba9b04e88021..8d7bc5dc936610253dde928e944f04c0028a8231 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(_weakref_getweakrefcount__doc__,
 "getweakrefcount($module, object, /)\n"
 "--\n"
@@ -110,4 +112,4 @@ skip_optional:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=f4be6b8177fbceb8 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=60f59adc1dc9eab8 input=a9049054013a1b77]*/
index 7fef127bef860676f341ad5cc4c5bab8c6162cf7..ae8cc1d6283217a13bffdd6c4df922bdd2f305b0 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_long.h"          // _PyLong_Size_t_Converter()
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(_winapi_Overlapped_GetOverlappedResult__doc__,
 "GetOverlappedResult($self, wait, /)\n"
@@ -1478,4 +1479,4 @@ exit:
 
     return return_value;
 }
-/*[clinic end generated code: output=6df38b5eb93f2e5a input=a9049054013a1b77]*/
+/*[clinic end generated code: output=aaf29735c47f55fe input=a9049054013a1b77]*/
index 6691d39deb7c24dc8844848030d9e229c4a309cc..9905b6425e2f7999fe568bdc7ea4ebbd26d387c6 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(zoneinfo_ZoneInfo_from_file__doc__,
 "from_file($type, file_obj, /, key=None)\n"
@@ -371,4 +372,4 @@ zoneinfo_ZoneInfo__unpickle(PyTypeObject *type, PyTypeObject *cls, PyObject *con
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=a5384f79d49a593b input=a9049054013a1b77]*/
+/*[clinic end generated code: output=2a15f32fdd2ab6cd input=a9049054013a1b77]*/
index 2a874b8c83060960bd3c92bb9dd109921a44d043..bff9fd3c87b6467e4dc361c47288e189718a0583 100644 (file)
@@ -3,6 +3,7 @@ preserve
 [clinic start generated code]*/
 
 #include "pycore_abstract.h"      // _PyNumber_Index()
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 
 PyDoc_STRVAR(array_array___copy____doc__,
 "__copy__($self, /)\n"
@@ -670,4 +671,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=8595b1906b5a6552 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d58693e1157540ef input=a9049054013a1b77]*/
index d80decf145bfdcdc676808cf8f826a896aea093f..b80983ca9a17095ab211614883028cc857afee35 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(binascii_a2b_uu__doc__,
 "a2b_uu($module, data, /)\n"
@@ -794,4 +795,4 @@ exit:
 
     return return_value;
 }
-/*[clinic end generated code: output=acc9419209dfd568 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=3259f3b018abee96 input=a9049054013a1b77]*/
index a665ac3c1c4994fb72c2f480c57e845247f2918d..b709204af1d9596213f4c02f9f6c12fc7a55dad4 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 
 PyDoc_STRVAR(cmath_acos__doc__,
 "acos($module, z, /)\n"
@@ -981,4 +982,4 @@ skip_optional_kwonly:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=96a5c4ae198dd5bf input=a9049054013a1b77]*/
+/*[clinic end generated code: output=364093af55bfe53f input=a9049054013a1b77]*/
index 83e882bbbaf18411a3216826e7ccb2da2a5bde98..5dc2fc068d0f7e4acba7888940f0fa61d5e94a21 100644 (file)
@@ -3,6 +3,7 @@ preserve
 [clinic start generated code]*/
 
 #include "pycore_fileutils.h"     // _PyLong_FileDescriptor_Converter()
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 
 PyDoc_STRVAR(fcntl_fcntl__doc__,
 "fcntl($module, fd, cmd, arg=0, /)\n"
@@ -245,4 +246,4 @@ skip_optional:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=4d4fac195494faec input=a9049054013a1b77]*/
+/*[clinic end generated code: output=732e33ba92042031 input=a9049054013a1b77]*/
index 40448404877e3e273b4cb51f85aa129ddfa8de0c..ad4469350447cbb3f7de93c47e67534e848189d5 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _Py_convert_optional_to_ssize_t()
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(gc_enable__doc__,
 "enable($module, /)\n"
@@ -424,4 +425,4 @@ gc_get_freeze_count(PyObject *module, PyObject *Py_UNUSED(ignored))
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=63093e7724b94a37 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5c345e7b4ce6085a input=a9049054013a1b77]*/
index e6c9cccfce4a762006553471b5edd9cba39f6aa1..1da061f3fd8eb12b0899ecfa8013333b9ba9d3fa 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(grp_getgrgid__doc__,
 "getgrgid($module, /, id)\n"
@@ -145,4 +146,4 @@ grp_getgrall(PyObject *module, PyObject *Py_UNUSED(ignored))
 {
     return grp_getgrall_impl(module);
 }
-/*[clinic end generated code: output=d4bdad9b26fb8558 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=2f7011384604d38d input=a9049054013a1b77]*/
index 74cd3ddc3c9a864e44a99386348d4d293fdd29b5..fa2c5e0e9223870a81b119d46b845448cf33d724 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _PyNumber_Index()
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(batched_new__doc__,
 "batched(iterable, n)\n"
@@ -913,4 +914,4 @@ skip_optional_pos:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=95bb863274717bd9 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=782fe7e30733779b input=a9049054013a1b77]*/
index bfce397be77c8be89a14e23917295b622567082c..ca14c03f16f706acc41158f1150d7f261ac42378 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 
 PyDoc_STRVAR(math_ceil__doc__,
 "ceil($module, x, /)\n"
@@ -949,4 +950,4 @@ math_ulp(PyObject *module, PyObject *arg)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=da62cea7eb3dc8bc input=a9049054013a1b77]*/
+/*[clinic end generated code: output=6b2eeaed8d8a76d5 input=a9049054013a1b77]*/
index 9a71e25aa557a4ef7d4fd6bba284d38093f81e5a..8e1d719e4433befa8627c82dd44cd35173a0dae9 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_long.h"          // _PyLong_UnsignedLong_Converter()
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 
 PyDoc_STRVAR(_overlapped_CreateIoCompletionPort__doc__,
 "CreateIoCompletionPort($module, handle, port, key, concurrency, /)\n"
@@ -1262,4 +1263,4 @@ exit:
 
     return return_value;
 }
-/*[clinic end generated code: output=31bcc780209593a2 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=85884c2341fcbef7 input=a9049054013a1b77]*/
index 179132754f9aeb8854c2c009e790e7039fdd908d..29c90c5c261b57e5ae76932b56198b674cb06d63 100644 (file)
@@ -9,6 +9,7 @@ preserve
 #include "pycore_abstract.h"      // _PyNumber_Index()
 #include "pycore_fileutils.h"     // _PyLong_FileDescriptor_Converter()
 #include "pycore_long.h"          // _PyLong_UnsignedInt_Converter()
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(os_stat__doc__,
 "stat($module, /, path, *, dir_fd=None, follow_symlinks=True)\n"
@@ -12414,4 +12415,4 @@ exit:
 #ifndef OS_WAITSTATUS_TO_EXITCODE_METHODDEF
     #define OS_WAITSTATUS_TO_EXITCODE_METHODDEF
 #endif /* !defined(OS_WAITSTATUS_TO_EXITCODE_METHODDEF) */
-/*[clinic end generated code: output=7c3058135ed49d20 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=274174066fff3256 input=a9049054013a1b77]*/
index 0e8aa5e6a9f470e92728159ed1da0a6080f6103a..43d4825031c7e614c0a9ff19fbbb5a0de0bbb12d 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_BadArgument()
+
 PyDoc_STRVAR(pwd_getpwuid__doc__,
 "getpwuid($module, uidobj, /)\n"
 "--\n"
@@ -71,4 +73,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=211c7a2516899b91 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5a8fb12939ff4ea3 input=a9049054013a1b77]*/
index 21b09110d0085326b9ee1c73cbc2908f59469f68..a5b93e68598204a123949754d3b2439e4024e8ac 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(pyexpat_xmlparser_Parse__doc__,
 "Parse($self, data, isfinal=False, /)\n"
@@ -497,4 +498,4 @@ exit:
 #ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
     #define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
 #endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */
-/*[clinic end generated code: output=ac398d94833e802d input=a9049054013a1b77]*/
+/*[clinic end generated code: output=48c4296e43777df4 input=a9049054013a1b77]*/
index e5a784a5f79e5af2175f7223015480ba43767caf..1c616d60f097cc5db2ee8d83375888cbc6aa4f0a 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(readline_parse_and_bind__doc__,
 "parse_and_bind($module, string, /)\n"
 "--\n"
@@ -682,4 +684,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=790ed2ba01babb60 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=358ab465285c7949 input=a9049054013a1b77]*/
index 0ac272af25d15454689a68f75d69c96f58498740..e4ef93900d17978975ac553ab5ebbc6bd002eba7 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 #if defined(HAVE_GETRUSAGE)
 
 PyDoc_STRVAR(resource_getrusage__doc__,
@@ -172,4 +174,4 @@ exit:
 #ifndef RESOURCE_PRLIMIT_METHODDEF
     #define RESOURCE_PRLIMIT_METHODDEF
 #endif /* !defined(RESOURCE_PRLIMIT_METHODDEF) */
-/*[clinic end generated code: output=2376b9a3f03777aa input=a9049054013a1b77]*/
+/*[clinic end generated code: output=8e905b2f5c35170e input=a9049054013a1b77]*/
index 282196b8f88973a9a44eefc700ce3970e1dde173..67e76d4c89f59ac36d7ccbeb286f8ebb16974ebc 100644 (file)
@@ -8,6 +8,7 @@ preserve
 #endif
 #include "pycore_fileutils.h"     // _PyLong_FileDescriptor_Converter()
 #include "pycore_long.h"          // _PyLong_UnsignedShort_Converter()
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 
 PyDoc_STRVAR(select_select__doc__,
 "select($module, rlist, wlist, xlist, timeout=None, /)\n"
@@ -1310,4 +1311,4 @@ exit:
 #ifndef SELECT_KQUEUE_CONTROL_METHODDEF
     #define SELECT_KQUEUE_CONTROL_METHODDEF
 #endif /* !defined(SELECT_KQUEUE_CONTROL_METHODDEF) */
-/*[clinic end generated code: output=35cd4aa7b6802838 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=4c2dcb31cb17c2c6 input=a9049054013a1b77]*/
index fa4ec8bb51e787c0af743da4a43654ad0827be26..ee391656fb67c31324ced075a48405d4629e2fa1 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(SHA1Type_copy__doc__,
 "copy($self, /)\n"
@@ -147,4 +148,4 @@ skip_optional_kwonly:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=7efbe42154a7a7f8 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=41fc7579213b57b4 input=a9049054013a1b77]*/
index 9fb8bf7de876fa8eb97d061624aedf8aba9fea23..ec31d5545be4c15029503a428899bc4f03969326 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(SHA256Type_copy__doc__,
 "copy($self, /)\n"
@@ -436,4 +437,4 @@ skip_optional_kwonly:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=1242ccc50bcefe98 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=1482d9de086e45c4 input=a9049054013a1b77]*/
index fd65462d62c19550f51c6112ef9cd96b9f2efcb1..738e9589503900dfa75237c40254c12db99719a3 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_long.h"          // _PyLong_UnsignedLong_Converter()
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(py_sha3_new__doc__,
 "sha3_224(data=b\'\', /, *, usedforsecurity=True)\n"
@@ -193,4 +194,4 @@ _sha3_shake_128_hexdigest(SHA3object *self, PyObject *arg)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=0888aed37ef39984 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a8e76a880d1421ec input=a9049054013a1b77]*/
index 5e8957a4be780d4270b1320142842d9cac76462a..bc33e0666543643dedd1b5584aaf209e330d68b4 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(signal_default_int_handler__doc__,
 "default_int_handler($module, signalnum, frame, /)\n"
 "--\n"
@@ -699,4 +701,4 @@ exit:
 #ifndef SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF
     #define SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF
 #endif /* !defined(SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF) */
-/*[clinic end generated code: output=ef4c2ad1a2443063 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5a9928cb2dc75b5f input=a9049054013a1b77]*/
index c62050160f1117e68bd5e1ca60cb563c416205f8..b6c74b1e9befd2cd623600e450405d82dde2fe80 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 static int
 sock_initobj_impl(PySocketSockObject *self, int family, int type, int proto,
@@ -90,4 +91,4 @@ skip_optional_pos:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=1b68ae94d6cbeeb1 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=c85517815c2d69cf input=a9049054013a1b77]*/
index 2cd08f81782007c6b0f38822a736aeae901a084d..2ecd3afc00d2be493c849e879cd0f7c074c0fb3a 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(_symtable_symtable__doc__,
 "symtable($module, source, filename, startstr, /)\n"
 "--\n"
@@ -48,4 +50,4 @@ _symtable_symtable(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=3f7ccf535d750238 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=931964a76a72f850 input=a9049054013a1b77]*/
index f0c6f2a871d042f94b72f36d229a2a04b6eda41d..58b0ea57b065b393c52f2510e65fd0158831cae3 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(syslog_openlog__doc__,
 "openlog($module, /, ident=<unrepresentable>, logoption=0,\n"
@@ -250,4 +251,4 @@ syslog_LOG_UPTO(PyObject *module, PyObject *arg)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=68942dad7fb3872e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=86ca2fd84b2da98e input=a9049054013a1b77]*/
index 78828e57d730775889353910f40f3f4087be6fde..1c340681e5862fd9947c4d04e83826ce15904364 100644 (file)
@@ -3,6 +3,7 @@ preserve
 [clinic start generated code]*/
 
 #include "pycore_fileutils.h"     // _PyLong_FileDescriptor_Converter()
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 
 PyDoc_STRVAR(termios_tcgetattr__doc__,
 "tcgetattr($module, fd, /)\n"
@@ -288,4 +289,4 @@ termios_tcsetwinsize(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=daecc8ebc8fe29f5 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f31382658135c774 input=a9049054013a1b77]*/
index 74362c6a6857b74abc56afe69fa1344404fa42d2..739f498f1d2672d9aec05ddb6870273414d76db0 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(unicodedata_UCD_decimal__doc__,
 "decimal($self, chr, default=<unrepresentable>, /)\n"
 "--\n"
@@ -517,4 +519,4 @@ unicodedata_UCD_lookup(PyObject *self, PyObject *arg)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=ca10ded25747d182 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ea30f89007b2bfff input=a9049054013a1b77]*/
index 895215307974f7a0e4228ba547749d1032dcd71a..850a4cd965267f045f73e732d39255370a391d86 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _PyNumber_Index()
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(zlib_compress__doc__,
 "compress($module, data, /, level=Z_DEFAULT_COMPRESSION, wbits=MAX_WBITS)\n"
@@ -1129,4 +1130,4 @@ exit:
 #ifndef ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF
     #define ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF
 #endif /* !defined(ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF) */
-/*[clinic end generated code: output=6d90c72ba2dd04c5 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=bd96ba786b0d8d42 input=a9049054013a1b77]*/
index 20e83de84e8340f8611fc3f05562ebc7c1455a17..9756f1c2fb15b1abf77845179b2b99160d031e92 100644 (file)
@@ -1,6 +1,11 @@
 
 /* UNIX group file access module */
 
+// clinic/grpmodule.c.h uses internal pycore_modsupport.h API
+#ifndef Py_BUILD_CORE_BUILTIN
+#  define Py_BUILD_CORE_MODULE 1
+#endif
+
 #include "Python.h"
 #include "posixmodule.h"
 
index d65509ec3436a20101b287b12f9951e46dbbf547..22ac31aa41919de6c358790f8c3ec161dc221a77 100644 (file)
@@ -1,3 +1,8 @@
+// clinic/resource.c.h uses internal pycore_modsupport.h API
+#ifndef Py_BUILD_CORE_BUILTIN
+#  define Py_BUILD_CORE_MODULE 1
+#endif
+
 #include "Python.h"
 #include <errno.h>                // errno
 #include <string.h>
index 6db8de9c491dd91538fefa38c375f804a0df6c13..6a44850e291448d7f521076035f2327850e72226 100644 (file)
@@ -49,6 +49,11 @@ Revision history:
 
 /* syslog module */
 
+// clinic/syslogmodule.c.h uses internal pycore_modsupport.h API
+#ifndef Py_BUILD_CORE_BUILTIN
+#  define Py_BUILD_CORE_MODULE 1
+#endif
+
 #include "Python.h"
 #include "osdefs.h"               // SEP
 
index f516707f6f80869393f3517a1ae6879ba1dde35c..f1a43be38b2b58511cb598cd7f2cd768f53e749a 100644 (file)
@@ -1,6 +1,7 @@
 /* Cell object implementation */
 
 #include "Python.h"
+#include "pycore_modsupport.h"    // _PyArg_NoKeywords()
 #include "pycore_object.h"
 
 PyObject *
index 7039db09721998f6a8fbe1c0823b263753575c25..02b9b57ca1369aa16e2dc977f6296fb771e97fe0 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _PyNumber_Index()
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 static int
 bytearray___init___impl(PyByteArrayObject *self, PyObject *arg,
@@ -1284,4 +1285,4 @@ bytearray_sizeof(PyByteArrayObject *self, PyObject *Py_UNUSED(ignored))
 {
     return bytearray_sizeof_impl(self);
 }
-/*[clinic end generated code: output=94b9b5f492b5fed6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=fc2b9ccabe0e6782 input=a9049054013a1b77]*/
index e2f9ba6c1e55bd8fdb77a54ce97762cbc1d992d3..8b08f8edb62109067860df23fe55105f1721e60a 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _PyNumber_Index()
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(bytes___bytes____doc__,
 "__bytes__($self, /)\n"
@@ -1060,4 +1061,4 @@ skip_optional_pos:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=8a9f5c28cbfe7592 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=da013a7e257f5c6e input=a9049054013a1b77]*/
index 48cfd6c7b78ca32beb47ab5711e31fe07828bd71..3e149c97324a6a9dd3ac6bbfb9b95f39c712cac2 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(method___reduce____doc__,
 "__reduce__($self, /)\n"
 "--\n"
@@ -80,4 +82,4 @@ instancemethod_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=a0d17bad3b0734d9 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5a5e3f2d0726f189 input=a9049054013a1b77]*/
index b20b066f494901a5ed991d5ac0698c8a2f29013d..68e2d7f528c06176134ca710d32bfb451d17df2a 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 
 PyDoc_STRVAR(code_new__doc__,
 "code(argcount, posonlyargcount, kwonlyargcount, nlocals, stacksize,\n"
@@ -463,4 +464,4 @@ code__varname_from_oparg(PyCodeObject *self, PyObject *const *args, Py_ssize_t n
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=b9ccfbfabe1a5f46 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d604263a3ca72a0f input=a9049054013a1b77]*/
index 788f30d54450f503f42cb66d78983cd9de05b0a6..49b50304021f7b98763e11ebba26d6e2451429fc 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_BadArgument()
 
 PyDoc_STRVAR(complex_conjugate__doc__,
 "conjugate($self, /)\n"
@@ -156,4 +157,4 @@ skip_optional_pos:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=002c74f8a33b6697 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=04e6261649967b30 input=a9049054013a1b77]*/
index 4f18fd77a2c7a0b0e27b850510dc92f429e86e7b..02fb440d9c83af89d2a078875153f571bc736c0a 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 static PyObject *
 mappingproxy_new_impl(PyTypeObject *type, PyObject *mapping);
@@ -166,4 +167,4 @@ skip_optional_pos:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=a97dc44d12f9f9b6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a4664ccf3da10f5a input=a9049054013a1b77]*/
index eda86c31fcc57873fa86adb032bd2f79abc2427b..641514235c23414d570328cee5d17ed1dfc849b4 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(dict_fromkeys__doc__,
 "fromkeys($type, iterable, value=None, /)\n"
 "--\n"
@@ -191,4 +193,4 @@ dict___reversed__(PyDictObject *self, PyObject *Py_UNUSED(ignored))
 {
     return dict___reversed___impl(self);
 }
-/*[clinic end generated code: output=582766ac0154c8bf input=a9049054013a1b77]*/
+/*[clinic end generated code: output=17c3c4cf9a9b95a7 input=a9049054013a1b77]*/
index 97f20c63cd4adfbb3e147ff85328e56b22a6588d..09774a73c8145c942c73a8fc7fea7cde23da2faf 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(enum_new__doc__,
 "enumerate(iterable, start=0)\n"
@@ -106,4 +107,4 @@ reversed_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=661b29708f501d19 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5c48a9a482a52e91 input=a9049054013a1b77]*/
index c40eff85cf35529cfa9788b288f2b9c33573f318..10f6149cc88c22fe34f69ea1366ab0e9cec9f109 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(float_is_integer__doc__,
 "is_integer($self, /)\n"
 "--\n"
@@ -316,4 +318,4 @@ float___format__(PyObject *self, PyObject *arg)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=eb093cc601cc5426 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=c79743c8551c30d9 input=a9049054013a1b77]*/
index 1be4567428690555393080a30c4c6cad4d9e2bce..138f87716acbf709827ba11841fe53b9f10d0718 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(func_new__doc__,
 "function(code, globals, name=None, argdefs=None, closure=None)\n"
@@ -103,4 +104,4 @@ skip_optional_pos:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=b2d676ff51c992d0 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ff7b995500d2bee6 input=a9049054013a1b77]*/
index b6f0c5c0c42dd40e15f8ca45e66088c9e3a9fdbc..b2178cd7f5f38389e6bd53102e0094280ce3eaa3 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _PyNumber_Index()
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 
 PyDoc_STRVAR(list_insert__doc__,
 "insert($self, index, object, /)\n"
@@ -383,4 +384,4 @@ list___reversed__(PyListObject *self, PyObject *Py_UNUSED(ignored))
 {
     return list___reversed___impl(self);
 }
-/*[clinic end generated code: output=e2d9f4092498a5ca input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5dea9dd3bb219a7f input=a9049054013a1b77]*/
index 9288648fe3b7c2120d1e7796f44a1a2070ba6064..4a3d71c6111af57643e6828b023a7b1b6b9892a3 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _PyNumber_Index()
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 static PyObject *
 long_new_impl(PyTypeObject *type, PyObject *x, PyObject *obase);
@@ -475,4 +476,4 @@ int_is_integer(PyObject *self, PyObject *Py_UNUSED(ignored))
 {
     return int_is_integer_impl(self);
 }
-/*[clinic end generated code: output=009a537ab558763c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=7e6e57246e55911f input=a9049054013a1b77]*/
index 74c749e0b6ccc8a5c6f4b772ce1ba8f39212e4d4..f199434dacb9e813858e4661a82aceb40c2ddfb1 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(memoryview__doc__,
 "memoryview(object)\n"
@@ -412,4 +413,4 @@ skip_optional_pos:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=7ebdadda3b0fcd35 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=7e76a09106921ba2 input=a9049054013a1b77]*/
index ce21e4728dcb9e2bb48dd11184a3f286759c2ec4..3c0bbe22d5ebabe21dc720192b476acf94226fdf 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(module___init____doc__,
 "module(name, doc=None)\n"
@@ -73,4 +74,4 @@ skip_optional_pos:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=9d3d7854d17a033c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=e8a71bfbed774c15 input=a9049054013a1b77]*/
index 643f504535d257e275041360a5df941eb541ce3d..5ef5380656905ab580085b65f6726bf66c6cf993 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(OrderedDict_fromkeys__doc__,
 "fromkeys($type, /, iterable, value=None)\n"
@@ -331,4 +332,4 @@ skip_optional_pos:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=6d7ae9fb552c6108 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=eff78d2a3f9379bd input=a9049054013a1b77]*/
index 2571888454cb793302f8bed662756374741781c5..cec49ebccccb243281b1e7516a237df8148a9c26 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 static PyObject *
 structseq_new_impl(PyTypeObject *type, PyObject *arg, PyObject *dict);
@@ -61,4 +62,4 @@ skip_optional_pos:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=2f88fe2a6f5c13a8 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5bf39b3f06a34ce4 input=a9049054013a1b77]*/
index f21712746a5ad120ba4622e9883f5ad3df55f152..5d6a2c481a5f2a23386f919e785018c7f86d3ed7 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(tuple_index__doc__,
 "index($self, value, start=0, stop=sys.maxsize, /)\n"
 "--\n"
@@ -112,4 +114,4 @@ tuple___getnewargs__(PyTupleObject *self, PyObject *Py_UNUSED(ignored))
 {
     return tuple___getnewargs___impl(self);
 }
-/*[clinic end generated code: output=7c5d9d12e0cf6a83 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a6a9abba5d121f4c input=a9049054013a1b77]*/
index eb0b22a943ae8f4435b0942425cc6e50cc586785..1fa153598db213376107d034fa63f1b403ea1d9c 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_BadArgument()
+
 PyDoc_STRVAR(type___instancecheck____doc__,
 "__instancecheck__($self, instance, /)\n"
 "--\n"
@@ -260,4 +262,4 @@ object___dir__(PyObject *self, PyObject *Py_UNUSED(ignored))
 {
     return object___dir___impl(self);
 }
-/*[clinic end generated code: output=943f639f264362d9 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b56c87f9cace1921 input=a9049054013a1b77]*/
index 22090b15481431440fa8037b2f817a517804d88d..2bb0a98a2ed64c303110dc6be9336cc47eca2c1a 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywordsWithVararg()
 
 PyDoc_STRVAR(typevar_new__doc__,
 "typevar(name, *constraints, bound=None, covariant=False,\n"
@@ -590,4 +591,4 @@ skip_optional_kwonly:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=027fb8cbef6e5015 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5a582d9d89ad787b input=a9049054013a1b77]*/
index 42b8a3c69cad8a1748260951f6e635ee3388779b..7711434f17c2bc5e1dad2499ee7e767a72a915f3 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _PyNumber_Index()
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 
 PyDoc_STRVAR(EncodingMap_size__doc__,
 "size($self, /)\n"
@@ -1504,4 +1505,4 @@ skip_optional_pos:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=4acdcfdc93f2a0f6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=873d8b3d09af3095 input=a9049054013a1b77]*/
index 56ce34f80ca8e9014c9299baccd7cfb04ba55f37..7f9f03d7dcab9f455cba862f41eb3e7a2d4c06da 100644 (file)
@@ -6,6 +6,7 @@
 #include "pycore_ceval.h"         // _Py_EnterRecursiveCallTstate()
 #include "pycore_emscripten_trampoline.h" // descr_set_trampoline_call(), descr_get_trampoline_call()
 #include "pycore_descrobject.h"   // _PyMethodWrapper_Type
+#include "pycore_modsupport.h"    // _PyArg_UnpackStack()
 #include "pycore_object.h"        // _PyObject_GC_UNTRACK()
 #include "pycore_pystate.h"       // _PyThreadState_GET()
 #include "pycore_tuple.h"         // _PyTuple_ITEMS()
index 62a44234b340478ab9809a9c0e718e79cfd382ff..48623451c0d2cd41ad829a0fb5af25fab19a5a6b 100644 (file)
@@ -8,10 +8,11 @@
 #include <stdbool.h>
 #include "pycore_abstract.h"      // _PyObject_RealIsSubclass()
 #include "pycore_ceval.h"         // _Py_EnterRecursiveCall
-#include "pycore_pyerrors.h"      // struct _PyErr_SetRaisedException
 #include "pycore_exceptions.h"    // struct _Py_exc_state
 #include "pycore_initconfig.h"
+#include "pycore_modsupport.h"    // _PyArg_NoKeywords()
 #include "pycore_object.h"
+#include "pycore_pyerrors.h"      // struct _PyErr_SetRaisedException
 
 #include "osdefs.h"               // SEP
 
index e8ad486150da479377cb4b26b41dbc18755db042..8665c7745ffb39c7506f791f93a9b37fe6b54017 100644 (file)
@@ -3,6 +3,7 @@
 
 #include "Python.h"
 #include "pycore_ceval.h"         // _PyEval_BuiltinsFromGlobals()
+#include "pycore_modsupport.h"    // _PyArg_NoKeywords()
 #include "pycore_object.h"        // _PyObject_GC_UNTRACK()
 #include "pycore_pyerrors.h"      // _PyErr_Occurred()
 
index bf13ed3650bac5f6f072d90599682d07c5a3780e..c045d495e8552655be739884310ea2e1d64ecc9f 100644 (file)
@@ -2,6 +2,7 @@
 
 #include "Python.h"
 #include "pycore_ceval.h"         // _PyEval_GetBuiltin()
+#include "pycore_modsupport.h"    // _PyArg_NoKeywords()
 #include "pycore_object.h"
 #include "pycore_unionobject.h"   // _Py_union_type_or, _PyGenericAlias_Check
 
index 40033d10bea9eec627481e027940a48901eb0572..491e631f2242e9a33c531fc74aaa2b24178812fb 100644 (file)
@@ -7,6 +7,7 @@
 #include "pycore_ceval.h"         // _PyEval_EvalFrame()
 #include "pycore_frame.h"         // _PyInterpreterFrame
 #include "pycore_genobject.h"     // struct _Py_async_gen_state
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 #include "pycore_object.h"        // _PyObject_GC_UNTRACK()
 #include "pycore_pyerrors.h"      // _PyErr_ClearExcState()
 #include "pycore_pystate.h"       // _PyThreadState_GET()
index 204c114fd9de2d93d7cd4e4228bd0a2a81d3fee8..b975bcfeea2cdf92fbecb5ba69b6c9ba1f342d96 100644 (file)
@@ -1,12 +1,12 @@
 // namespace object implementation
 
 #include "Python.h"
+#include "pycore_modsupport.h"    // _PyArg_NoPositional()
 #include "pycore_namespace.h"     // _PyNamespace_Type
 
 #include <stddef.h>               // offsetof()
 
 
-
 typedef struct {
     PyObject_HEAD
     PyObject *ns_dict;
index 5ffc52ae674c82209e852ada012ba269a9decb26..1513f3e49abb44dbc9081d43c4669d632a9699ab 100644 (file)
@@ -16,6 +16,7 @@ this type and there is exactly one in existence.
 #include "Python.h"
 #include "pycore_abstract.h"      // _PyIndex_Check()
 #include "pycore_long.h"          // _PyLong_GetZero()
+#include "pycore_modsupport.h"    // _PyArg_NoKeywords()
 #include "pycore_object.h"        // _PyObject_GC_TRACK()
 
 
index e81c5916e6f1966d8bb569e138be67392174d2d9..3a985ab5c7a9f548f289711858637733979021ab 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _PyNumber_Index()
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(stringlib_expandtabs__doc__,
 "expandtabs($self, /, tabsize=8)\n"
@@ -278,4 +279,4 @@ stringlib_zfill(PyObject *self, PyObject *arg)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=39cd1ee983137188 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b409bdf9ab68d5a6 input=a9049054013a1b77]*/
index e4a4b45a8db626c2e928fb611f60b5034d2e4d16..db4aebebdd8404ea576f51472c516237c7eb9991 100644 (file)
@@ -9,11 +9,11 @@
 
 #include "Python.h"
 #include "pycore_dict.h"          // _PyDict_Pop()
-#include "pycore_tuple.h"         // _PyTuple_FromArray()
+#include "pycore_initconfig.h"    // _PyStatus_OK()
+#include "pycore_modsupport.h"    // _PyArg_NoPositional()
 #include "pycore_object.h"        // _PyObject_GC_TRACK()
-
 #include "pycore_structseq.h"     // PyStructSequence_InitType()
-#include "pycore_initconfig.h"    // _PyStatus_OK()
+#include "pycore_tuple.h"         // _PyTuple_FromArray()
 
 static const char visible_length_key[] = "n_sequence_fields";
 static const char real_length_key[] = "n_fields";
index 310aa86d94d9b6b07afa75b82efec5b4c155a870..fdf09ec6ec6f634775c09a09cf7fa16795526047 100644 (file)
@@ -8,6 +8,11 @@
 // Version history
 //  2022-08: Initial contribution (Steve Dower)
 
+// clinic/_wmimodule.cpp.h uses internal pycore_modsupport.h API
+#ifndef Py_BUILD_CORE_BUILTIN
+#  define Py_BUILD_CORE_MODULE 1
+#endif
+
 #define _WIN32_DCOM
 #include <Windows.h>
 #include <comdef.h>
index 99cd302ff34698b0ec838bcfa10a7179beadbba2..2c71c11c438b5bba0b76024559fa30e5e02a49a4 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 #if defined(MS_WINDOWS)
 
@@ -139,4 +140,4 @@ exit:
 #ifndef _TESTCONSOLE_READ_OUTPUT_METHODDEF
     #define _TESTCONSOLE_READ_OUTPUT_METHODDEF
 #endif /* !defined(_TESTCONSOLE_READ_OUTPUT_METHODDEF) */
-/*[clinic end generated code: output=f59fe72cd4e73704 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=08a1c844b3657272 input=a9049054013a1b77]*/
index 3ece5e6823b4624c63346600287c1ef1170a4273..fccf3d795d5340856d51509e5778f7625792bfb9 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(_wmi_exec_query__doc__,
 "exec_query($module, /, query)\n"
@@ -68,4 +69,4 @@ _wmi_exec_query(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=53821e597fc2aca4 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ba04920d127f3ceb input=a9049054013a1b77]*/
index 54ae61bd4f10a950a7e51ee1992dee0d672b663f..e3f7ea43f38211baabf6cc49cbf8f66274159479 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(msvcrt_heapmin__doc__,
 "heapmin($module, /)\n"
 "--\n"
@@ -695,4 +697,4 @@ exit:
 #ifndef MSVCRT_GETERRORMODE_METHODDEF
     #define MSVCRT_GETERRORMODE_METHODDEF
 #endif /* !defined(MSVCRT_GETERRORMODE_METHODDEF) */
-/*[clinic end generated code: output=525ec6ac4e3cb4f2 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=de9687b46212c2ed input=a9049054013a1b77]*/
index 7507c1151a98405be12e029e90e7796c76c7c464..7e5545e113e7187e0fc89c92314f74c1da1ba3af 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_long.h"          // _PyLong_UnsignedLong_Converter()
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 
 #if (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM) || defined(MS_WINDOWS_GAMES))
 
@@ -1761,4 +1762,4 @@ exit:
 #ifndef WINREG_QUERYREFLECTIONKEY_METHODDEF
     #define WINREG_QUERYREFLECTIONKEY_METHODDEF
 #endif /* !defined(WINREG_QUERYREFLECTIONKEY_METHODDEF) */
-/*[clinic end generated code: output=d7ae41899af53d7c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=1ee4098b2f143b6a input=a9049054013a1b77]*/
index b8c8e7d04a699f779a2a65cf885ef4a67054daac..32a9a3de2e937f512850dbbf7ab326d649dd20c0 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(winsound_PlaySound__doc__,
 "PlaySound($module, /, sound, flags)\n"
@@ -205,4 +206,4 @@ skip_optional_pos:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=21584101f656198f input=a9049054013a1b77]*/
+/*[clinic end generated code: output=191d4fb1542c7abf input=a9049054013a1b77]*/
index 68a917810f884debe2833a7cdf2393da2f93e901..2881490b7e81a3185ae8931c290c78823f7fd868 100644 (file)
    winsound.PlaySound(None, 0)
 */
 
+// clinic/winsound.c.h uses internal pycore_modsupport.h API
+#ifndef Py_BUILD_CORE_BUILTIN
+#  define Py_BUILD_CORE_MODULE 1
+#endif
+
 #include <Python.h>
 #include <windows.h>
 #include <mmsystem.h>
index f240779d2a5d4e89d459f6bd3f625c98622166ce..b35a2904d49d4413ce8cd68f822b13564cf922ab 100644 (file)
     <ClInclude Include="..\Include\cpython\longobject.h" />
     <ClInclude Include="..\Include\cpython\memoryobject.h" />
     <ClInclude Include="..\Include\cpython\methodobject.h" />
-    <ClInclude Include="..\Include\cpython\modsupport.h" />
     <ClInclude Include="..\Include\cpython\object.h" />
     <ClInclude Include="..\Include\cpython\objimpl.h" />
     <ClInclude Include="..\Include\cpython\odictobject.h" />
index 6e13eb81018f9b476b4953e7b331b56f4a809e11..9adfebc107a77305e96b058a39f588b1fe3f4911 100644 (file)
     <ClInclude Include="..\Include\cpython\methodobject.h">
       <Filter>Include\cpython</Filter>
     </ClInclude>
-    <ClInclude Include="..\Include\cpython\modsupport.h">
-      <Filter>Include\cpython</Filter>
-    </ClInclude>
     <ClInclude Include="..\Include\cpython\objimpl.h">
       <Filter>Include\cpython</Filter>
     </ClInclude>
index a8453e25807b0d68cdbf7b15e243e23a55b2ce33..730fa8ef2a21546fa85a3bbe638d89352d7c5d10 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 static PyObject *
 tokenizeriter_new_impl(PyTypeObject *type, PyObject *readline,
@@ -79,4 +80,4 @@ skip_optional_kwonly:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=406b5a433a59069c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=dcd6ec48f06a092e input=a9049054013a1b77]*/
index cf3c73b1cf0e6e56747d95d238abada747b08339..98dc49db3059b166805a039db238e61345554e41 100644 (file)
@@ -7,6 +7,7 @@ preserve
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
 #include "pycore_abstract.h"      // _PyNumber_Index()
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(warnings_warn__doc__,
 "warn($module, /, message, category=None, stacklevel=1, source=None, *,\n"
@@ -243,4 +244,4 @@ warnings_filters_mutated(PyObject *module, PyObject *Py_UNUSED(ignored))
 {
     return warnings_filters_mutated_impl(module);
 }
-/*[clinic end generated code: output=8c396a721ef75739 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f2d4214c382717a6 input=a9049054013a1b77]*/
index b4dcc6bf1d29782c485f4087ea55c57003e0a2f2..8d40e659b54a57ea2a33a6db09062b1d734a6d1e 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(builtin___import____doc__,
 "__import__($module, /, name, globals=None, locals=None, fromlist=(),\n"
@@ -1211,4 +1212,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=607c62f2341ebfc0 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=31bded5d08647a57 input=a9049054013a1b77]*/
index 292d3f7f4ff49c7c1e70d5a180d29b6d8878b011..997ac6f63384a9ab42a71c1c06ec1305e31fa7c5 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(_contextvars_Context_get__doc__,
 "get($self, key, default=None, /)\n"
 "--\n"
@@ -177,4 +179,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=2436b16a92452869 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b667826178444c3f input=a9049054013a1b77]*/
index 890c3026fc9996bb10693cbe04074ba05bb9858b..3ecd2acb1cd286b736fd39e5397b88162dd53c3e 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 
 PyDoc_STRVAR(_imp_lock_held__doc__,
 "lock_held($module, /)\n"
@@ -626,4 +627,4 @@ exit:
 #ifndef _IMP_EXEC_DYNAMIC_METHODDEF
     #define _IMP_EXEC_DYNAMIC_METHODDEF
 #endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */
-/*[clinic end generated code: output=058f6aa1c9f4ebe4 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=c37ad1bf06f9e947 input=a9049054013a1b77]*/
index 1b1b6d048b0dd0d6ae5cbfa7585c8457f5c89a4a..8dae747c44a543d186f1cfe25d5ba510b322f65e 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(monitoring_use_tool_id__doc__,
 "use_tool_id($module, tool_id, name, /)\n"
 "--\n"
@@ -302,4 +304,4 @@ monitoring__all_events(PyObject *module, PyObject *Py_UNUSED(ignored))
 {
     return monitoring__all_events_impl(module);
 }
-/*[clinic end generated code: output=46f449b18195f976 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=14ffc0884a6de50a input=a9049054013a1b77]*/
index 16e48f77c87fdbe943b64ebc85f436ea77d6ad44..ecde4f6482d30e30f1d234d58b5a142cc6ee8c7a 100644 (file)
@@ -2,6 +2,8 @@
 preserve
 [clinic start generated code]*/
 
+#include "pycore_modsupport.h"    // _PyArg_CheckPositional()
+
 PyDoc_STRVAR(marshal_dump__doc__,
 "dump($module, value, file, version=version, /)\n"
 "--\n"
@@ -155,4 +157,4 @@ exit:
 
     return return_value;
 }
-/*[clinic end generated code: output=23091e077319f596 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=99ba446b1a75a269 input=a9049054013a1b77]*/
index 06105e221c1f89a27943d457c49ae71bb293572b..98717ecc875b8bcede7145d385d7c7c1833c8a44 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(sys_addaudithook__doc__,
 "addaudithook($module, /, hook)\n"
@@ -1451,4 +1452,4 @@ exit:
 #ifndef SYS_GETANDROIDAPILEVEL_METHODDEF
     #define SYS_GETANDROIDAPILEVEL_METHODDEF
 #endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */
-/*[clinic end generated code: output=3a7d3fbbcb281c22 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f36d45c829250775 input=a9049054013a1b77]*/
index c5687e3074878264a2e6c8b86075c5c9b6697825..aee08d6ad97047e3e77e11752ab02ec588c35d0d 100644 (file)
@@ -6,6 +6,7 @@ preserve
 #  include "pycore_gc.h"          // PyGC_Head
 #  include "pycore_runtime.h"     // _Py_ID()
 #endif
+#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()
 
 PyDoc_STRVAR(tb_new__doc__,
 "TracebackType(tb_next, tb_frame, tb_lasti, tb_lineno)\n"
@@ -77,4 +78,4 @@ tb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=57e27eb68d04d842 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=4e2f6b935841b09c input=a9049054013a1b77]*/
index e21698619468d8c6f15ce7be14bef4cf9449a170..80d2540a694d7a2fb3b609d152175e711fc8d111 100644 (file)
@@ -4,6 +4,7 @@
 #include "Python.h"
 #include "pycore_abstract.h"      // _PyNumber_Index()
 #include "pycore_dict.h"          // _PyDict_HasOnlyStringKeys()
+#include "pycore_modsupport.h"    // export _PyArg_NoKeywords()
 #include "pycore_pylifecycle.h"   // _PyArg_Fini
 #include "pycore_tuple.h"         // _PyTuple_ITEMS()
 
index 3112e7cb286f9d8eef0bec9104a45a60965f44d0..5dd7900851550a04a7ca4ff50c2ff956d67edb2b 100755 (executable)
@@ -1344,6 +1344,8 @@ class CLanguage(Language):
                             """,
                         indent=4))
             else:
+                clinic.add_include('pycore_modsupport.h',
+                                   '_PyArg_CheckPositional()')
                 parser_code = [normalize_snippet(f"""
                     if (!_PyArg_CheckPositional("{{name}}", {nargs}, {min_pos}, {max_args})) {{{{
                         goto exit;
@@ -1401,6 +1403,8 @@ class CLanguage(Language):
                 if limited_capi:
                     fastcall = False
                 if fastcall:
+                    clinic.add_include('pycore_modsupport.h',
+                                       '_PyArg_ParseStack()')
                     parser_code = [normalize_snippet("""
                         if (!_PyArg_ParseStack(args, nargs, "{format_units}:{name}",
                             {parse_arguments})) {{
@@ -1429,6 +1433,11 @@ class CLanguage(Language):
 
             has_optional_kw = (max(pos_only, min_pos) + min_kw_only < len(converters) - int(vararg != NO_VARARG))
             if vararg == NO_VARARG:
+                # FIXME: refactor the code to not declare args_declaration
+                # if limited_capi is true
+                if not limited_capi:
+                    clinic.add_include('pycore_modsupport.h',
+                                       '_PyArg_UnpackKeywords()')
                 args_declaration = "_PyArg_UnpackKeywords", "%s, %s, %s" % (
                     min_pos,
                     max_pos,
@@ -1436,6 +1445,9 @@ class CLanguage(Language):
                 )
                 nargs = "nargs"
             else:
+                if not limited_capi:
+                    clinic.add_include('pycore_modsupport.h',
+                                       '_PyArg_UnpackKeywordsWithVararg()')
                 args_declaration = "_PyArg_UnpackKeywordsWithVararg", "%s, %s, %s, %s" % (
                     min_pos,
                     max_pos,
@@ -1574,6 +1586,8 @@ class CLanguage(Language):
                         declarations += "\nPy_ssize_t nargs = PyTuple_Size(args);"
 
                 elif fastcall:
+                    clinic.add_include('pycore_modsupport.h',
+                                       '_PyArg_ParseStackAndKeywords()')
                     parser_code = [normalize_snippet("""
                         if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser{parse_arguments_comma}
                             {parse_arguments})) {{
@@ -1581,6 +1595,8 @@ class CLanguage(Language):
                         }}
                         """, indent=4)]
                 else:
+                    clinic.add_include('pycore_modsupport.h',
+                                       '_PyArg_ParseTupleAndKeywordsFast()')
                     parser_code = [normalize_snippet("""
                         if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser,
                             {parse_arguments})) {{
@@ -1626,12 +1642,16 @@ class CLanguage(Language):
 
             if not parses_keywords:
                 declarations = '{base_type_ptr}'
+                clinic.add_include('pycore_modsupport.h',
+                                   '_PyArg_NoKeywords()')
                 fields.insert(0, normalize_snippet("""
                     if ({self_type_check}!_PyArg_NoKeywords("{name}", kwargs)) {{
                         goto exit;
                     }}
                     """, indent=4))
                 if not parses_positional:
+                    clinic.add_include('pycore_modsupport.h',
+                                       '_PyArg_NoPositional()')
                     fields.insert(0, normalize_snippet("""
                         if ({self_type_check}!_PyArg_NoPositional("{name}", args)) {{
                             goto exit;
@@ -3500,6 +3520,8 @@ class CConverter(metaclass=CConverterAutoRegister):
         else:
             if expected_literal:
                 expected = f'"{expected}"'
+            if clinic is not None:
+                clinic.add_include('pycore_modsupport.h', '_PyArg_BadArgument()')
             return f'_PyArg_BadArgument("{{{{name}}}}", "{displayname}", {expected}, {{argname}});'
 
     def format_code(self, fmt: str, *,