Module: kamailio Branch: 5.5 Commit: 3cdc934292a866bb4980cfb5e1cffa6138282940 URL: https://github.com/kamailio/kamailio/commit/3cdc934292a866bb4980cfb5e1cffa61...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Victor Seva linuxmaniac@torreviejawireless.org Date: 2023-05-08T15:48:13+02:00
app_python3: use Py_SET_TYPE() from python 3.9
(cherry picked from commit fc75b4c3f8f9bdba320f74ddf942686c09316b56) (cherry picked from commit 07fc4d54e1c00a155dc17c25998ab2cbf75d0862)
---
Modified: src/modules/app_python3/python_msgobj.c
---
Diff: https://github.com/kamailio/kamailio/commit/3cdc934292a866bb4980cfb5e1cffa61... Patch: https://github.com/kamailio/kamailio/commit/3cdc934292a866bb4980cfb5e1cffa61...
---
diff --git a/src/modules/app_python3/python_msgobj.c b/src/modules/app_python3/python_msgobj.c index 5a263ea7b36..af425c85b1c 100644 --- a/src/modules/app_python3/python_msgobj.c +++ b/src/modules/app_python3/python_msgobj.c @@ -537,7 +537,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;