Skip to content

Commit d57dfa1

Browse files
fix(build): added compability fix for python 3.9
1 parent ed08a8d commit d57dfa1

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎src/dbzero/bindings/python/shared_py_object.hpp‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
#include <iostream>
88
#include <thread>
99

10+
#if PY_VERSION_HEX < 0x030A0000
11+
static inline PyObject *Py_NewRef(PyObject *obj)
12+
{
13+
Py_INCREF(obj);
14+
return obj;
15+
}
16+
#endif
17+
1018
// Extended inc-ref, handles additional ref-counter for memo objects
1119
// must dec-ref with PyEXT_DECREF
1220
#define PyEXT_INCREF(ptr) db0::python::incExtRef(ptr)
@@ -270,4 +278,4 @@ namespace std
270278
}
271279
};
272280

273-
}
281+
}

0 commit comments

Comments
 (0)