summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2023-08-28 13:04:27 (GMT)
committerGitHub <noreply@github.com>2023-08-28 13:04:27 (GMT)
commitbc5356bb5d7e3eda44128e89a695c05066e0840b (patch)
treed9c923aaa06b991fd874ccb693fcb5bdf8fb015d /Modules
parentd90973340bf5ac35e0b35e99239cd37c46a30910 (diff)
downloadcpython-bc5356bb5d7e3eda44128e89a695c05066e0840b.zip
cpython-bc5356bb5d7e3eda44128e89a695c05066e0840b.tar.gz
cpython-bc5356bb5d7e3eda44128e89a695c05066e0840b.tar.bz2
gh-108494: Argument Clinic: fix support of Limited C API (GH-108536)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_localemodule.c1
-rw-r--r--Modules/_sqlite/module.c2
-rw-r--r--Modules/_struct.c3
-rw-r--r--Modules/_tracemalloc.c1
-rw-r--r--Modules/clinic/_testclinic_limited.c.h5
5 files changed, 7 insertions, 5 deletions
diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c
index e4b956b..1847a48 100644
--- a/Modules/_localemodule.c
+++ b/Modules/_localemodule.c
@@ -11,6 +11,7 @@ This software comes with no warranty. Use at your own risk.
#include "Python.h"
#include "pycore_fileutils.h"
+#include "pycore_pymem.h" // _PyMem_Strdup
#include <stdio.h>
#include <locale.h>
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c
index dd45ffc..46fed9f 100644
--- a/Modules/_sqlite/module.c
+++ b/Modules/_sqlite/module.c
@@ -244,7 +244,7 @@ load_functools_lru_cache(PyObject *module)
static PyMethodDef module_methods[] = {
PYSQLITE_ADAPT_METHODDEF
PYSQLITE_COMPLETE_STATEMENT_METHODDEF
- PYSQLITE_CONNECT_METHODDEF
+ {"connect", _PyCFunction_CAST(pysqlite_connect), METH_FASTCALL|METH_KEYWORDS, pysqlite_connect__doc__},
PYSQLITE_ENABLE_CALLBACK_TRACE_METHODDEF
PYSQLITE_REGISTER_ADAPTER_METHODDEF
PYSQLITE_REGISTER_CONVERTER_METHODDEF
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 4da6542..4ae21cc 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -108,6 +108,7 @@ class cache_struct_converter(CConverter):
type = 'PyStructObject *'
converter = 'cache_struct_converter'
c_default = "NULL"
+ broken_limited_capi = True
def parse_arg(self, argname, displayname):
return """
@@ -120,7 +121,7 @@ class cache_struct_converter(CConverter):
def cleanup(self):
return "Py_XDECREF(%s);\n" % self.name
[python start generated code]*/
-/*[python end generated code: output=da39a3ee5e6b4b0d input=d6746621c2fb1a7d]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=14e83804f599ed8f]*/
static int cache_struct_converter(PyObject *, PyObject *, PyStructObject **);
diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c
index f3f4af9..6dba3cac 100644
--- a/Modules/_tracemalloc.c
+++ b/Modules/_tracemalloc.c
@@ -1,4 +1,5 @@
#include "Python.h"
+#include "pycore_tracemalloc.h" // _PyTraceMalloc_IsTracing
#include "clinic/_tracemalloc.c.h"
diff --git a/Modules/clinic/_testclinic_limited.c.h b/Modules/clinic/_testclinic_limited.c.h
index 9b00325..93e7d7f 100644
--- a/Modules/clinic/_testclinic_limited.c.h
+++ b/Modules/clinic/_testclinic_limited.c.h
@@ -37,8 +37,7 @@ my_int_func(PyObject *module, PyObject *arg_)
int arg;
int _return_value;
- arg = PyLong_AsInt(arg_);
- if (arg == -1 && PyErr_Occurred()) {
+ if (!PyArg_Parse(arg_, "i:my_int_func", &arg)) {
goto exit;
}
_return_value = my_int_func_impl(module, arg);
@@ -82,4 +81,4 @@ my_int_sum(PyObject *module, PyObject *args)
exit:
return return_value;
}
-/*[clinic end generated code: output=f9f7209255bb969e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=dcd5203d0d29df3a input=a9049054013a1b77]*/