Explorar o código

app_python3: use Py_SET_TYPE() from python 3.9

Daniel-Constantin Mierla %!s(int64=2) %!d(string=hai) anos
pai
achega
fc75b4c3f8
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      src/modules/app_python3/python_msgobj.c

+ 4 - 0
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;