Compatibility with other Python version

This commit is contained in:
Matthias Koefferlein 2023-03-30 20:09:17 +02:00
parent 692e5b4a01
commit 2166437480
1 changed files with 2 additions and 1 deletions

View File

@ -267,7 +267,8 @@ public:
if (! cls->parent ()) {
PyList_Append (m_all_list, c2python (cls->name ()));
PyModule_AddObjectRef (mp_module->module (), cls->name ().c_str (), (PyObject *) pt);
Py_INCREF ((PyObject *) pt);
PyModule_AddObject (mp_module->module (), cls->name ().c_str (), (PyObject *) pt);
}
}