summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-10-05 00:34:03 (GMT)
committerGitHub <noreply@github.com>2022-10-05 00:34:03 (GMT)
commit76449350b3467b85bcb565f9e2bf945bd150a66e (patch)
treee4237841cdb9d9984e3249823a8518c79470d73f /Modules
parent0ff8fd65838f9f9ed90d7a055d26a2ce9fc0ce85 (diff)
downloadcpython-76449350b3467b85bcb565f9e2bf945bd150a66e.zip
cpython-76449350b3467b85bcb565f9e2bf945bd150a66e.tar.gz
cpython-76449350b3467b85bcb565f9e2bf945bd150a66e.tar.bz2
GH-91079: Decouple C stack overflow checks from Python recursion checks. (GH-96510)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_testinternalcapi.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c
index 02a061b..5724bd5 100644
--- a/Modules/_testinternalcapi.c
+++ b/Modules/_testinternalcapi.c
@@ -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);
}