mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever
possible. Patch is writen with Coccinelle.
This commit is contained in:
parent
60e6e962ba
commit
228b12edcc
57 changed files with 225 additions and 445 deletions
36
PC/_msi.c
36
PC/_msi.c
|
|
@ -262,8 +262,7 @@ static PyObject* fcicreate(PyObject* obj, PyObject* args)
|
|||
if (!FCIDestroy(hfci))
|
||||
goto err;
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
Py_RETURN_NONE;
|
||||
err:
|
||||
if(erf.fError)
|
||||
PyErr_Format(PyExc_ValueError, "FCI error %d", erf.erfOper); /* XXX better error type */
|
||||
|
|
@ -291,8 +290,7 @@ msiobj_close(msiobj* msidb, PyObject *args)
|
|||
{
|
||||
MsiCloseHandle(msidb->h);
|
||||
msidb->h = 0;
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
|
|
@ -401,8 +399,7 @@ record_cleardata(msiobj* record, PyObject *args)
|
|||
if (status != ERROR_SUCCESS)
|
||||
return msierror(status);
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
|
|
@ -418,8 +415,7 @@ record_setstring(msiobj* record, PyObject *args)
|
|||
if ((status = MsiRecordSetStringW(record->h, field, data)) != ERROR_SUCCESS)
|
||||
return msierror(status);
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
|
|
@ -435,8 +431,7 @@ record_setstream(msiobj* record, PyObject *args)
|
|||
if ((status = MsiRecordSetStreamW(record->h, field, data)) != ERROR_SUCCESS)
|
||||
return msierror(status);
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
|
|
@ -452,8 +447,7 @@ record_setinteger(msiobj* record, PyObject *args)
|
|||
if ((status = MsiRecordSetInteger(record->h, field, data)) != ERROR_SUCCESS)
|
||||
return msierror(status);
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -617,8 +611,7 @@ summary_setproperty(msiobj* si, PyObject *args)
|
|||
if (status != ERROR_SUCCESS)
|
||||
return msierror(status);
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -630,8 +623,7 @@ summary_persist(msiobj* si, PyObject *args)
|
|||
status = MsiSummaryInfoPersist(si->h);
|
||||
if (status != ERROR_SUCCESS)
|
||||
return msierror(status);
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyMethodDef summary_methods[] = {
|
||||
|
|
@ -714,8 +706,7 @@ view_execute(msiobj *view, PyObject*args)
|
|||
if (status != ERROR_SUCCESS)
|
||||
return msierror(status);
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
|
|
@ -764,8 +755,7 @@ view_modify(msiobj *view, PyObject *args)
|
|||
if ((status = MsiViewModify(view->h, kind, ((msiobj*)data)->h)) != ERROR_SUCCESS)
|
||||
return msierror(status);
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
|
|
@ -776,8 +766,7 @@ view_close(msiobj *view, PyObject*args)
|
|||
if ((status = MsiViewClose(view->h)) != ERROR_SUCCESS)
|
||||
return msierror(status);
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyMethodDef view_methods[] = {
|
||||
|
|
@ -872,8 +861,7 @@ msidb_commit(msiobj *msidb, PyObject *args)
|
|||
if ((status = MsiDatabaseCommit(msidb->h)) != ERROR_SUCCESS)
|
||||
return msierror(status);
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue