From: Gregory Trubetskoy <grisha@modpython.org>
Date: Fri, 16 Jun 2023 18:29:50 -0400
Subject: 3.10 and up do not need a PyThreadState_Clear()

Closes #100

Bug-Upstream: https://github.com/grisha/mod_python/issues/100
Bug-Debian: https://bugs.debian.org/1019299
Origin: upstream, https://github.com/grisha/mod_python/commit/7e863bb4652ca4edeb158bf42eb26120e0e54040
---
 src/mod_python.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mod_python.c b/src/mod_python.c
index 6259c1b..11af968 100644
--- a/src/mod_python.c
+++ b/src/mod_python.c
@@ -303,7 +303,9 @@ static void release_interpreter(interpreterdata *idata)
 {
     PyThreadState *tstate = PyThreadState_Get();
 #ifdef WITH_THREAD
+#if PY_MAJOR_VERSION <= 3 && PY_MINOR_VERSION < 10 
     PyThreadState_Clear(tstate);
+#endif
     if (idata)
         APR_ARRAY_PUSH(idata->tstates, PyThreadState *) = tstate;
     else
