blob: 3ea77e6934db1b09ed1fe15bb358dc333d3ad2ac [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"
Victor Stinner331a6a52019-05-27 16:39:22 +020012#include "pycore_initconfig.h"
Victor Stinner23bace22019-04-18 11:37:26 +020013
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}