Part: replace PyObject_IsTrue with Base::asBoolean

This commit is contained in:
wmayer
2022-07-16 13:31:10 +02:00
parent 343aadf02b
commit 8ae3185e3b
38 changed files with 141 additions and 161 deletions

View File

@@ -62,14 +62,14 @@ int GeometryBoolExtensionPy::PyInit(PyObject* args, PyObject* /*kwd*/)
PyErr_Clear();
PyObject* val;
if (PyArg_ParseTuple(args, "O!", &PyBool_Type, &val)) {
this->getGeometryBoolExtensionPtr()->setValue(PyObject_IsTrue(val) ? true : false);
this->getGeometryBoolExtensionPtr()->setValue(Base::asBoolean(val));
return 0;
}
PyErr_Clear();
char * pystr;
if (PyArg_ParseTuple(args, "O!s", &PyBool_Type, &val, &pystr)) {
this->getGeometryBoolExtensionPtr()->setValue(PyObject_IsTrue(val) ? true : false);
this->getGeometryBoolExtensionPtr()->setValue(Base::asBoolean(val));
this->getGeometryBoolExtensionPtr()->setName(pystr);
return 0;
}