Package: libapache2-mod-python / 3.5.0+git20211031.e6458ec-1+deb12u1

15_py310_threadstate_clear.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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