Module: kamailio
Branch: master
Commit: ca37f9247ecb6754fbdbd210fc59158bf0f32def
URL:
https://github.com/kamailio/kamailio/commit/ca37f9247ecb6754fbdbd210fc59158…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-02-11T09:14:06+01:00
app_python3: handle deprecated PyEval_InitThreads()
-
https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads
- GH #2626
---
Modified: src/modules/app_python3/app_python3_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/ca37f9247ecb6754fbdbd210fc59158…
Patch:
https://github.com/kamailio/kamailio/commit/ca37f9247ecb6754fbdbd210fc59158…
---
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;