Part: replace PyObject_IsTrue with Base::asBoolean
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user