Module: kamailio
Branch: 5.6
Commit: 07fc4d54e1c00a155dc17c25998ab2cbf75d0862
URL:
https://github.com/kamailio/kamailio/commit/07fc4d54e1c00a155dc17c25998ab2c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2023-02-15T10:35:23+01:00
app_python3: use Py_SET_TYPE() from python 3.9
(cherry picked from commit fc75b4c3f8f9bdba320f74ddf942686c09316b56)
---
Modified: src/modules/app_python3/python_msgobj.c
---
Diff:
https://github.com/kamailio/kamailio/commit/07fc4d54e1c00a155dc17c25998ab2c…
Patch:
https://github.com/kamailio/kamailio/commit/07fc4d54e1c00a155dc17c25998ab2c…
---
diff --git a/src/modules/app_python3/python_msgobj.c
b/src/modules/app_python3/python_msgobj.c
index db6da6a07a..22aebd5404 100644
--- a/src/modules/app_python3/python_msgobj.c
+++ b/src/modules/app_python3/python_msgobj.c
@@ -507,7 +507,11 @@ static PyTypeObject MSGtype = {
int python_msgobj_init(void)
{
+#if PY_VERSION_HEX >= 0x03090000
+ Py_SET_TYPE(&MSGtype, &PyType_Type);
+#else
Py_TYPE(&MSGtype) = &PyType_Type;
+#endif
if (PyType_Ready(&MSGtype) < 0)
return -1;
return 0;