summaryrefslogtreecommitdiffstats
path: root/Modules/_testcapimodule.c
diff options
context:
space:
mode:
authorPetr Viktorin <encukou@gmail.com>2022-04-28 14:30:28 (GMT)
committerGitHub <noreply@github.com>2022-04-28 14:30:28 (GMT)
commit6dcbc08c95cce4630b3bfb53bdb74e2523795555 (patch)
treead1c12daa5201e81b6c68df6d46f26d8cf75688c /Modules/_testcapimodule.c
parentd1de10784d9678d14759d0d03216431d1090e60e (diff)
downloadcpython-6dcbc08c95cce4630b3bfb53bdb74e2523795555.zip
cpython-6dcbc08c95cce4630b3bfb53bdb74e2523795555.tar.gz
cpython-6dcbc08c95cce4630b3bfb53bdb74e2523795555.tar.bz2
gh-91324: List feature macros in the stable ABI manifest, improve tests (GH-32415)
Diffstat (limited to 'Modules/_testcapimodule.c')
-rw-r--r--Modules/_testcapimodule.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 6bd73e8..9073f33 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -5919,6 +5919,18 @@ frame_getlasti(PyObject *self, PyObject *frame)
return PyLong_FromLong(lasti);
}
+static PyObject *
+get_feature_macros(PyObject *self, PyObject *Py_UNUSED(args))
+{
+ PyObject *result = PyDict_New();
+ if (!result) {
+ return NULL;
+ }
+ int res;
+#include "_testcapi_feature_macros.inc"
+ return result;
+}
+
static PyObject *negative_dictoffset(PyObject *, PyObject *);
static PyObject *test_buildvalue_issue38913(PyObject *, PyObject *);
@@ -6214,6 +6226,7 @@ static PyMethodDef TestMethods[] = {
{"frame_getgenerator", frame_getgenerator, METH_O, NULL},
{"frame_getbuiltins", frame_getbuiltins, METH_O, NULL},
{"frame_getlasti", frame_getlasti, METH_O, NULL},
+ {"get_feature_macros", get_feature_macros, METH_NOARGS, NULL},
{NULL, NULL} /* sentinel */
};