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:
4
Python/Python-ast.c
generated
4
Python/Python-ast.c
generated
@@ -13081,8 +13081,8 @@ PyObject* PyAST_mod2obj(mod_ty t)
|
||||
if (!tstate) {
|
||||
return 0;
|
||||
}
|
||||
state->recursion_limit = C_RECURSION_LIMIT * COMPILER_STACK_FRAME_SCALE;
|
||||
int recursion_depth = C_RECURSION_LIMIT - tstate->c_recursion_remaining;
|
||||
state->recursion_limit = Py_C_RECURSION_LIMIT * COMPILER_STACK_FRAME_SCALE;
|
||||
int recursion_depth = Py_C_RECURSION_LIMIT - tstate->c_recursion_remaining;
|
||||
starting_recursion_depth = recursion_depth * COMPILER_STACK_FRAME_SCALE;
|
||||
state->recursion_depth = starting_recursion_depth;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user