blob: 3a43ec16850fcf508aff40d37cfa88f558ccf28c [file] [log] [blame]
Victor Stinner23bace22019-04-18 11:37:26 +02001/*
2 * C Extension module to test Python internal C APIs (Include/internal).
3 */
4
5#if !defined(Py_BUILD_CORE_BUILTIN) && !defined(Py_BUILD_CORE_MODULE)
6# error "Py_BUILD_CORE_BUILTIN or Py_BUILD_CORE_MODULE must be defined"
7#endif
8
9#define PY_SSIZE_T_CLEAN
10
11#include "Python.h"
12#include "pycore_coreconfig.h"
13
14
15static PyObject *
16get_configs(PyObject *self, PyObject *Py_UNUSED(args))
17{
18 return _Py_GetConfigsAsDict();
19}
20
21
22static PyMethodDef TestMethods[] = {
23 {"get_configs", get_configs, METH_NOARGS},
24 {NULL, NULL} /* sentinel */
25};
26
27
28static struct PyModuleDef _testcapimodule = {
29 PyModuleDef_HEAD_INIT,
30 "_testinternalcapi",
31 NULL,
32 -1,
33 TestMethods,
34 NULL,
35 NULL,
36 NULL,
37 NULL
38};
39
40
41PyMODINIT_FUNC
42PyInit__testinternalcapi(void)
43{
44 return PyModule_Create(&_testcapimodule);
45}