Skip to content

Commit

Permalink
Replace Py_True/False w/PyBool_FromLong
Browse files Browse the repository at this point in the history
  • Loading branch information
JCGoran committed Jan 10, 2025
1 parent 638ff3f commit 97d2bb7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/nrnpython/nrnpy_hoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ static PyObject* nrnexec(PyObject* self, PyObject* args) {
return NULL;
}
bool b = hoc_valid_stmt(cmd, 0);
return b ? Py_True : Py_False;
return PyBool_FromLong(b);
}

static PyObject* nrnexec_safe(PyObject* self, PyObject* args) {
Expand Down
2 changes: 1 addition & 1 deletion src/nrnpython/nrnpy_nrn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ static PyObject* NPySecObj_has_membrane(NPySecObj* self, PyObject* args) {
if (!PyArg_ParseTuple(args, "s", &mechanism_name)) {
return NULL;
}
result = has_membrane(mechanism_name, self->sec_) ? Py_True : Py_False;
result = PyBool_FromLong(has_membrane(mechanism_name, self->sec_));
Py_XINCREF(result);
return result;
}
Expand Down

0 comments on commit 97d2bb7

Please sign in to comment.