mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
GH-91079: Decouple C stack overflow checks from Python recursion checks. (GH-96510)
This commit is contained in:
parent
0ff8fd6583
commit
76449350b3
22 changed files with 165 additions and 99 deletions
|
|
@ -44,9 +44,7 @@ get_recursion_depth(PyObject *self, PyObject *Py_UNUSED(args))
|
|||
{
|
||||
PyThreadState *tstate = _PyThreadState_GET();
|
||||
|
||||
/* subtract one to ignore the frame of the get_recursion_depth() call */
|
||||
|
||||
return PyLong_FromLong(tstate->recursion_limit - tstate->recursion_remaining - 1);
|
||||
return PyLong_FromLong(tstate->py_recursion_limit - tstate->py_recursion_remaining);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue