[sr-dev] git:5.4:f9f33d37: app_python3: handle deprecated PyEval_InitThreads()

Daniel-Constantin Mierla miconda at gmail.com
Thu Feb 11 09:19:20 CET 2021


Module: kamailio
Branch: 5.4
Commit: f9f33d37f80003836cf87338a4dd96b1b4614c22
URL: https://github.com/kamailio/kamailio/commit/f9f33d37f80003836cf87338a4dd96b1b4614c22

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-02-11T09:18:42+01:00

app_python3: handle deprecated PyEval_InitThreads()

- https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads
- GH #2626

(cherry picked from commit ca37f9247ecb6754fbdbd210fc59158bf0f32def)

---

Modified: src/modules/app_python3/app_python3_mod.c

---

Diff:  https://github.com/kamailio/kamailio/commit/f9f33d37f80003836cf87338a4dd96b1b4614c22.diff
Patch: https://github.com/kamailio/kamailio/commit/f9f33d37f80003836cf87338a4dd96b1b4614c22.patch

---

diff --git a/src/modules/app_python3/app_python3_mod.c b/src/modules/app_python3/app_python3_mod.c
index 502a6d540b..0ce93b71cd 100644
--- a/src/modules/app_python3/app_python3_mod.c
+++ b/src/modules/app_python3/app_python3_mod.c
@@ -346,7 +346,9 @@ int apy_load_script(void)
 	}
 
 	Py_Initialize();
+#if PY_VERSION_HEX < 0x03070000
 	PyEval_InitThreads();
+#endif
 	myThreadState = PyThreadState_Get();
 
 	PY_GIL_ENSURE;




More information about the sr-dev mailing list