Skip to content

Commit

Permalink
Fix return none in cmaboss
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-noel committed Nov 15, 2024
1 parent cf1daa5 commit 5670b7a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
6 changes: 3 additions & 3 deletions engine/python/cmaboss/maboss_net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ PyObject* cMaBoSSNetwork_setOutput(cMaBoSSNetworkObject* self, PyObject *args)
node->isInternal(true);
}
}
return Py_None;
Py_RETURN_NONE;
}

PyObject* cMaBoSSNetwork_getOutput(cMaBoSSNetworkObject* self)
Expand Down Expand Up @@ -181,7 +181,7 @@ PyObject* cMaBoSSNetwork_setObservedGraphNode(cMaBoSSNetworkObject* self, PyObje
node->inGraph(false);
}
}
return Py_None;
Py_RETURN_NONE;
}

PyObject* cMaBoSSNetwork_getObservedGraphNode(cMaBoSSNetworkObject* self, PyObject *args)
Expand Down Expand Up @@ -213,7 +213,7 @@ PyObject* cMaBoSSNetwork_addNode(cMaBoSSNetworkObject* self, PyObject *args)
return NULL;
}

return Py_None;
Py_RETURN_NONE;
}

PyObject* cMaBoSSNetwork_setIState(cMaBoSSNetworkObject* self, PyObject *args)
Expand Down
2 changes: 1 addition & 1 deletion engine/python/cmaboss/maboss_sim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ PyObject* cMaBoSSSim_check(cMaBoSSSimObject* self, PyObject *args, PyObject* kwa
PyErr_SetString(PyBNException, e.getMessage().c_str());
return NULL;
}
return Py_None;
Py_RETURN_NONE;
}

PyObject* cMaBoSSSim_get_logical_rules(cMaBoSSSimObject* self, PyObject *args, PyObject* kwargs) {
Expand Down
11 changes: 4 additions & 7 deletions engine/python/cmaboss/popmaboss_net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,7 @@ PyObject* cPopMaBoSSNetwork_getDeathRate(cPopMaBoSSNetworkObject* self)
{
const Expression* death_rate = self->network->getDeathRate();
if (death_rate == NULL) {
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

PyObject* death_rate_str = PyUnicode_FromString(
Expand Down Expand Up @@ -177,8 +176,7 @@ PyObject* cPopMaBoSSNetwork_setDeathRate(cPopMaBoSSNetworkObject* self, PyObject
return NULL;
}

Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

PyObject* cPopMaBoSSNetwork_setOutput(cPopMaBoSSNetworkObject* self, PyObject *args)
Expand All @@ -195,7 +193,7 @@ PyObject* cPopMaBoSSNetwork_setOutput(cPopMaBoSSNetworkObject* self, PyObject *a
node->isInternal(true);
}
}
return Py_None;
Py_RETURN_NONE;
}

PyObject* cPopMaBoSSNetwork_getOutput(cPopMaBoSSNetworkObject* self)
Expand Down Expand Up @@ -252,8 +250,7 @@ PyObject* cPopMaBoSSNetwork_addDivisionRule(cPopMaBoSSNetworkObject* self, PyObj
return NULL;
}

Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

PyObject* cPopMaBoSSNetwork_getDivisionRules(cPopMaBoSSNetworkObject* self)
Expand Down

0 comments on commit 5670b7a

Please sign in to comment.