python: use proper way to return None (#3209)

This commit is contained in:
Anton Kochkov 2023-08-02 14:30:05 +08:00 committed by GitHub
parent 7418f9c76c
commit de0e55d684
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,7 @@ PyObject *api_refresh(PyObject *self, PyObject *args)
Q_UNUSED(self);
Q_UNUSED(args);
Core()->triggerRefreshAll();
return Py_None;
Py_RETURN_NONE;
}
PyObject *api_message(PyObject *self, PyObject *args, PyObject *kwargs)
@ -46,8 +46,7 @@ PyObject *api_message(PyObject *self, PyObject *args, PyObject *kwargs)
return NULL;
}
Core()->message(QString(message), debug);
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}
PyMethodDef CutterMethods[] = {