Base: add convenience function to convert PyObject_IsTrue to a boolean
This commit is contained in:
@@ -122,6 +122,10 @@ inline PyObject* getTypeAsObject(PyTypeObject* type) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
inline bool asBoolean(PyObject *obj) {
|
||||
return PyObject_IsTrue(obj) != 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*------------------------------
|
||||
|
||||
Reference in New Issue
Block a user