kamailio: add patch fixing fragile kamcmd
[feed/telephony.git] / net / kamailio / patches / 172-app_python3-use-Py_SET_TYPE-from-python-3.9.patch
1 From fc75b4c3f8f9bdba320f74ddf942686c09316b56 Mon Sep 17 00:00:00 2001
2 From: Daniel-Constantin Mierla <miconda@gmail.com>
3 Date: Fri, 13 Jan 2023 12:41:12 +0100
4 Subject: [PATCH] app_python3: use Py_SET_TYPE() from python 3.9
5
6 ---
7 src/modules/app_python3/python_msgobj.c | 4 ++++
8 1 file changed, 4 insertions(+)
9
10 --- a/src/modules/app_python3/python_msgobj.c
11 +++ b/src/modules/app_python3/python_msgobj.c
12 @@ -507,7 +507,11 @@ static PyTypeObject MSGtype = {
13
14 int python_msgobj_init(void)
15 {
16 +#if PY_VERSION_HEX >= 0x03090000
17 + Py_SET_TYPE(&MSGtype, &PyType_Type);
18 +#else
19 Py_TYPE(&MSGtype) = &PyType_Type;
20 +#endif
21 if (PyType_Ready(&MSGtype) < 0)
22 return -1;
23 return 0;