Base: add convenience function to convert PyObject_IsTrue to a boolean

This commit is contained in:
wmayer
2022-07-16 12:41:01 +02:00
parent b42e994ec9
commit 231de30c2f

View File

@@ -122,6 +122,10 @@ inline PyObject* getTypeAsObject(PyTypeObject* type) {
return obj;
}
inline bool asBoolean(PyObject *obj) {
return PyObject_IsTrue(obj) != 0;
}
}
/*------------------------------