diff options
author | Victor Stinner <vstinner@python.org> | 2023-10-17 12:30:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-17 12:30:31 (GMT) |
commit | be5e8a010341c4d2d28ef53a1baed402ee06466e (patch) | |
tree | 6372a45676c7d5b8d07c69b67e889bbaf8f307e1 /Modules/_sqlite/clinic | |
parent | 054f496bd45cf94eac4158fd60ac95ab5f8e45c4 (diff) | |
download | cpython-be5e8a010341c4d2d28ef53a1baed402ee06466e.zip cpython-be5e8a010341c4d2d28ef53a1baed402ee06466e.tar.gz cpython-be5e8a010341c4d2d28ef53a1baed402ee06466e.tar.bz2 |
gh-110964: Remove private _PyArg functions (#110966)
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
Diffstat (limited to 'Modules/_sqlite/clinic')
-rw-r--r-- | Modules/_sqlite/clinic/_sqlite3.connect.c.h | 3 | ||||
-rw-r--r-- | Modules/_sqlite/clinic/blob.c.h | 4 | ||||
-rw-r--r-- | Modules/_sqlite/clinic/connection.c.h | 3 | ||||
-rw-r--r-- | Modules/_sqlite/clinic/cursor.c.h | 3 | ||||
-rw-r--r-- | Modules/_sqlite/clinic/module.c.h | 3 | ||||
-rw-r--r-- | Modules/_sqlite/clinic/row.c.h | 4 |
6 files changed, 14 insertions, 6 deletions
diff --git a/Modules/_sqlite/clinic/_sqlite3.connect.c.h b/Modules/_sqlite/clinic/_sqlite3.connect.c.h index eceb5a7..1bcda77 100644 --- a/Modules/_sqlite/clinic/_sqlite3.connect.c.h +++ b/Modules/_sqlite/clinic/_sqlite3.connect.c.h @@ -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]*/ diff --git a/Modules/_sqlite/clinic/blob.c.h b/Modules/_sqlite/clinic/blob.c.h index e7c6026..2c63817 100644 --- a/Modules/_sqlite/clinic/blob.c.h +++ b/Modules/_sqlite/clinic/blob.c.h @@ -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]*/ diff --git a/Modules/_sqlite/clinic/connection.c.h b/Modules/_sqlite/clinic/connection.c.h index fcc6577..46761cd 100644 --- a/Modules/_sqlite/clinic/connection.c.h +++ b/Modules/_sqlite/clinic/connection.c.h @@ -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]*/ diff --git a/Modules/_sqlite/clinic/cursor.c.h b/Modules/_sqlite/clinic/cursor.c.h index 3cb637b..a13e0d0 100644 --- a/Modules/_sqlite/clinic/cursor.c.h +++ b/Modules/_sqlite/clinic/cursor.c.h @@ -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]*/ diff --git a/Modules/_sqlite/clinic/module.c.h b/Modules/_sqlite/clinic/module.c.h index 49ba7a3..529dc4e 100644 --- a/Modules/_sqlite/clinic/module.c.h +++ b/Modules/_sqlite/clinic/module.c.h @@ -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]*/ diff --git a/Modules/_sqlite/clinic/row.c.h b/Modules/_sqlite/clinic/row.c.h index cdf850d..e8d1dbf 100644 --- a/Modules/_sqlite/clinic/row.c.h +++ b/Modules/_sqlite/clinic/row.c.h @@ -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]*/ |