summaryrefslogtreecommitdiffstats
path: root/PC/_msi.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-01-23 07:47:21 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-01-23 07:47:21 (GMT)
commit228b12edcce49649d6befa3c03dbcefd5a22ae76 (patch)
tree1066be6909fb981fcf30e1a8e224d43567bd9b92 /PC/_msi.c
parent60e6e962bac6a668d0df539ebf526a0a1c69eacd (diff)
downloadcpython-228b12edcce49649d6befa3c03dbcefd5a22ae76.zip
cpython-228b12edcce49649d6befa3c03dbcefd5a22ae76.tar.gz
cpython-228b12edcce49649d6befa3c03dbcefd5a22ae76.tar.bz2
Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever
possible. Patch is writen with Coccinelle.
Diffstat (limited to 'PC/_msi.c')
-rw-r--r--PC/_msi.c36
1 files changed, 12 insertions, 24 deletions
diff --git a/PC/_msi.c b/PC/_msi.c
index 789b04f..feb0088 100644
--- a/PC/_msi.c
+++ b/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*