App: Use PyObject_IsTrue in combination with conditional ternary operator
This commit is contained in:
committed by
Chris Hennes
parent
7798e8f42b
commit
1bc43b8606
@@ -174,11 +174,11 @@ PyObject* ExtensionContainerPy::hasExtension(PyObject *args) {
|
||||
|
||||
char *type;
|
||||
PyObject *deriv = Py_True;
|
||||
if (!PyArg_ParseTuple(args, "s|O", &type, &deriv))
|
||||
if (!PyArg_ParseTuple(args, "s|O!", &type, &PyBool_Type, &deriv))
|
||||
return nullptr;
|
||||
|
||||
//get the extension type asked for
|
||||
bool derived = PyObject_IsTrue(deriv);
|
||||
bool derived = PyObject_IsTrue(deriv) ? true : false;
|
||||
Base::Type extension = Base::Type::fromName(type);
|
||||
if (extension.isBad() || !extension.isDerivedFrom(App::Extension::getExtensionClassTypeId())) {
|
||||
std::stringstream str;
|
||||
|
||||
Reference in New Issue
Block a user