mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +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
|
@ -1046,10 +1046,10 @@ _PyAST_Validate(mod_ty mod)
|
|||
return 0;
|
||||
}
|
||||
/* Be careful here to prevent overflow. */
|
||||
int recursion_depth = C_RECURSION_LIMIT - tstate->c_recursion_remaining;
|
||||
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;
|
||||
state.recursion_limit = C_RECURSION_LIMIT * COMPILER_STACK_FRAME_SCALE;
|
||||
state.recursion_limit = Py_C_RECURSION_LIMIT * COMPILER_STACK_FRAME_SCALE;
|
||||
|
||||
switch (mod->kind) {
|
||||
case Module_kind:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue