1
0
forked from GitHub/gf-core

fix compilation for Python < 3.10

This commit is contained in:
Krasimir Angelov
2022-10-26 07:40:21 +02:00
parent d784e2584b
commit 58910975ad

View File

@@ -675,7 +675,10 @@ PGF_embed(PGFObject* self, PyObject *modname)
if (m == NULL)
return NULL;
if (PyModule_AddObjectRef(m, "__pgf__", (PyObject*) self) != 0) {
Py_INCREF(self);
if (PyModule_AddObject(m, "__pgf__", (PyObject*) self) != 0) {
Py_DECREF(self);
Py_DECREF(m);
return NULL;
}