Gui: Use PyObject_IsTrue in combination with conditional ternary operator

This commit is contained in:
marioalexis
2022-05-17 12:41:58 -03:00
committed by Chris Hennes
parent 80492e81fa
commit ae56fb62a7
8 changed files with 35 additions and 34 deletions

View File

@@ -831,7 +831,7 @@ PyObject* Application::sSendActiveView(PyObject * /*self*/, PyObject *args)
const char* ppReturn = nullptr;
if (!Instance->sendMsgToActiveView(psCommandStr,&ppReturn)) {
if (!PyObject_IsTrue(suppress))
if (PyObject_IsTrue(suppress) ? false : true)
Base::Console().Warning("Unknown view command: %s\n",psCommandStr);
}
@@ -852,7 +852,7 @@ PyObject* Application::sSendFocusView(PyObject * /*self*/, PyObject *args)
const char* ppReturn = nullptr;
if (!Instance->sendMsgToFocusView(psCommandStr,&ppReturn)) {
if (!PyObject_IsTrue(suppress))
if (PyObject_IsTrue(suppress) ? false : true)
Base::Console().Warning("Unknown view command: %s\n",psCommandStr);
}