mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
GH-91079: Rename C_RECURSION_LIMIT to Py_C_RECURSION_LIMIT (#108507)
Symbols of the C API should be prefixed by "Py_" to avoid conflict with existing names in 3rd party C extensions on "#include <Python.h>". test.pythoninfo now logs Py_C_RECURSION_LIMIT constant and other _testcapi and _testinternalcapi constants.
This commit is contained in:
parent
15d4c9fabc
commit
b0edf3b98e
17 changed files with 67 additions and 39 deletions
|
@ -3922,6 +3922,7 @@ PyInit__testcapi(void)
|
|||
PyModule_AddObject(m, "instancemethod", (PyObject *)&PyInstanceMethod_Type);
|
||||
|
||||
PyModule_AddIntConstant(m, "the_number_three", 3);
|
||||
PyModule_AddIntMacro(m, Py_C_RECURSION_LIMIT);
|
||||
|
||||
TestError = PyErr_NewException("_testcapi.error", NULL, NULL);
|
||||
Py_INCREF(TestError);
|
||||
|
|
|
@ -1552,6 +1552,11 @@ module_exec(PyObject *module)
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (PyModule_Add(module, "SIZEOF_PYOBJECT",
|
||||
PyLong_FromSsize_t(sizeof(PyObject))) < 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (PyModule_Add(module, "SIZEOF_TIME_T",
|
||||
PyLong_FromSsize_t(sizeof(time_t))) < 0) {
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue