aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/ceval_macros.h
diff options
context:
space:
mode:
Diffstat (limited to 'Python/ceval_macros.h')
-rw-r--r--Python/ceval_macros.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/ceval_macros.h b/Python/ceval_macros.h
index 8dc8b754485..5e2db1e0b39 100644
--- a/Python/ceval_macros.h
+++ b/Python/ceval_macros.h
@@ -364,3 +364,8 @@ static const convertion_func_ptr CONVERSION_FUNCTIONS[4] = {
#else
#define _Py_atomic_load_relaxed_int32(ATOMIC_VAL) _Py_atomic_load_relaxed(ATOMIC_VAL)
#endif
+
+static inline int _Py_EnterRecursivePy(PyThreadState *tstate) {
+ return (tstate->py_recursion_remaining-- <= 0) &&
+ _Py_CheckRecursiveCallPy(tstate);
+}