summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/header-py.c12
-rw-r--r--python/rpmds-py.c15
-rw-r--r--python/rpmfi-py.c12
-rw-r--r--python/rpmmacro-py.c6
-rw-r--r--python/rpmmi-py.c7
-rw-r--r--python/rpmmodule.c3
-rw-r--r--python/rpmps-py.c3
-rw-r--r--python/rpmte-py.c9
-rw-r--r--python/rpmts-py.c30
9 files changed, 32 insertions, 65 deletions
diff --git a/python/header-py.c b/python/header-py.c
index f1c1f663b..ebae98d8e 100644
--- a/python/header-py.c
+++ b/python/header-py.c
@@ -214,8 +214,7 @@ static PyObject * hdrExpandFilelist(hdrObject * s)
{
headerConvert(s->h, HEADERCONV_EXPANDFILELIST);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/** \ingroup py_c
@@ -224,8 +223,7 @@ static PyObject * hdrCompressFilelist(hdrObject * s)
{
headerConvert(s->h, HEADERCONV_COMPRESSFILELIST);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* make a header with _all_ the tags we need */
@@ -254,8 +252,7 @@ static PyObject * hdrFullFilelist(hdrObject * s)
{
mungeFilelist (s->h);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/** \ingroup py_c
@@ -763,8 +760,7 @@ rpmMergeHeadersFromFD(PyObject * self, PyObject * args, PyObject * kwds)
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/**
diff --git a/python/rpmds-py.c b/python/rpmds-py.c
index 7b54aa7b5..63f52e99d 100644
--- a/python/rpmds-py.c
+++ b/python/rpmds-py.c
@@ -74,8 +74,7 @@ rpmds_Debug(rpmdsObject * s, PyObject * args, PyObject * kwds)
if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", kwlist, &_rpmds_debug))
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -242,8 +241,7 @@ rpmds_Next(rpmdsObject * s)
result = rpmds_iternext(s);
if (result == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
return result;
}
@@ -273,8 +271,7 @@ rpmds_Notify(rpmdsObject * s, PyObject * args, PyObject * kwds)
return NULL;
rpmdsNotify(s->ds, where, rc);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* XXX rpmdsFind uses bsearch on s->ds, so a sort is needed. */
@@ -282,8 +279,7 @@ static PyObject *
rpmds_Sort(rpmdsObject * s)
{
/* XXX sort on (N,EVR,F) here. */
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -370,8 +366,7 @@ rpmds_Problem(rpmdsObject * s)
{
if (!PyArg_ParseTuple(args, ":Problem"))
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
#endif
diff --git a/python/rpmfi-py.c b/python/rpmfi-py.c
index 61bcb324f..c4c90cf5f 100644
--- a/python/rpmfi-py.c
+++ b/python/rpmfi-py.c
@@ -27,8 +27,7 @@ rpmfi_Debug(rpmfiObject * s, PyObject * args, PyObject * kwds)
if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", kwlist, &_rpmfi_debug))
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -237,8 +236,7 @@ rpmfi_Next(rpmfiObject * s)
result = rpmfi_iternext(s);
if (result == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
return result;
@@ -248,15 +246,13 @@ rpmfi_Next(rpmfiObject * s)
static PyObject *
rpmfi_NextD(rpmfiObject * s)
{
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
rpmfi_InitD(rpmfiObject * s)
{
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
#endif
diff --git a/python/rpmmacro-py.c b/python/rpmmacro-py.c
index a056998d2..1b54f6ad0 100644
--- a/python/rpmmacro-py.c
+++ b/python/rpmmacro-py.c
@@ -26,8 +26,7 @@ rpmmacro_AddMacro(PyObject * self, PyObject * args, PyObject * kwds)
addMacro(NULL, name, NULL, val, -1);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/**
@@ -43,8 +42,7 @@ rpmmacro_DelMacro(PyObject * self, PyObject * args, PyObject * kwds)
delMacro(NULL, name);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/**
diff --git a/python/rpmmi-py.c b/python/rpmmi-py.c
index c5d3aed95..95060ab13 100644
--- a/python/rpmmi-py.c
+++ b/python/rpmmi-py.c
@@ -106,8 +106,7 @@ rpmmi_Next(rpmmiObject * s)
result = rpmmi_iternext(s);
if (result == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
return result;
}
@@ -160,9 +159,7 @@ rpmmi_Pattern(rpmmiObject * s, PyObject * args, PyObject * kwds)
rpmdbSetIteratorRE(s->mi, tag, type, pattern);
- Py_INCREF (Py_None);
- return Py_None;
-
+ Py_RETURN_NONE;
}
/** \ingroup py_c
diff --git a/python/rpmmodule.c b/python/rpmmodule.c
index 4d04761a5..8fa82e3e5 100644
--- a/python/rpmmodule.c
+++ b/python/rpmmodule.c
@@ -85,8 +85,7 @@ static PyObject * checkSignals(PyObject * self, PyObject * args)
{
if (!PyArg_ParseTuple(args, ":checkSignals")) return NULL;
rpmdbCheckSignals();
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
diff --git a/python/rpmps-py.c b/python/rpmps-py.c
index 7355d18bd..858d6476f 100644
--- a/python/rpmps-py.c
+++ b/python/rpmps-py.c
@@ -25,8 +25,7 @@ rpmps_Debug(rpmpsObject * s, PyObject * args, PyObject * kwds)
if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", kwlist, &_rpmps_debug))
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static int
diff --git a/python/rpmte-py.c b/python/rpmte-py.c
index 8fa413548..bfafada1a 100644
--- a/python/rpmte-py.c
+++ b/python/rpmte-py.c
@@ -62,8 +62,7 @@ rpmte_Debug(rpmteObject * s, PyObject * args, PyObject * kwds)
if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", kwlist, &_rpmte_debug))
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -205,8 +204,7 @@ rpmte_DS(rpmteObject * s, PyObject * args, PyObject * kwds)
PyErr_SetString(PyExc_TypeError, "invalid ds tag");
return NULL;
#else
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
#endif
}
return (PyObject *) rpmds_Wrap(rpmdsLink(ds, RPMDBG_M("rpmte_DS")));
@@ -219,8 +217,7 @@ rpmte_FI(rpmteObject * s, PyObject * args, PyObject * kwds)
fi = rpmteFI(s->te);
if (fi == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
return (PyObject *) rpmfi_Wrap(rpmfiLink(fi, RPMDBG_M("rpmte_FI")));
}
diff --git a/python/rpmts-py.c b/python/rpmts-py.c
index 7d7197eb2..e4c776498 100644
--- a/python/rpmts-py.c
+++ b/python/rpmts-py.c
@@ -174,8 +174,7 @@ rpmts_Debug(rpmtsObject * s, PyObject * args, PyObject * kwds)
if (_rpmts_debug < 0)
fprintf(stderr, "*** rpmts_Debug(%p) ts %p\n", s, s->ts);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
RPM_GNUC_NORETURN
@@ -239,8 +238,7 @@ fprintf(stderr, "*** rpmts_AddInstall(%p,%p,%p,%s) ts %p\n", s, h, key, how, s->
if (key)
PyList_Append(s->keyList, key);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/** \ingroup py_c
@@ -416,8 +414,7 @@ fprintf(stderr, "*** rpmts_Check(%p) ts %p cb %p\n", s, s->ts, cbInfo.cb);
return list;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/** \ingroup py_c
@@ -447,8 +444,7 @@ fprintf(stderr, "*** rpmts_Clean(%p) ts %p\n", s, s->ts);
rpmtsClean(s->ts);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/** \ingroup py_c
@@ -603,8 +599,7 @@ fprintf(stderr, "*** rpmts_HdrCheck(%p) ts %p\n", s, s->ts);
return NULL;
if (blob == Py_None) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
if (!PyString_Check(blob)) {
PyErr_SetString(pyrpmError, "hdrCheck takes a string of octets");
@@ -706,8 +701,7 @@ fprintf(stderr, "*** rpmts_PgpPrtPkts(%p) ts %p\n", s, s->ts);
return NULL;
if (blob == Py_None) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
if (!PyString_Check(blob)) {
PyErr_SetString(pyrpmError, "pgpPrtPkts takes a string of octets");
@@ -740,8 +734,7 @@ fprintf(stderr, "*** rpmts_PgpImportPubkey(%p) ts %p\n", s, s->ts);
return NULL;
if (blob == Py_None) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
if (!PyString_Check(blob)) {
PyErr_SetString(pyrpmError, "PgpImportPubkey takes a string of octets");
@@ -770,8 +763,7 @@ fprintf(stderr, "*** rpmts_GetKeys(%p) ts %p\n", s, s->ts);
rpmtsGetKeys(s->ts, &data, &num);
if (data == NULL || num <= 0) {
data = _free(data);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
tuple = PyTuple_New(num);
@@ -954,8 +946,7 @@ fprintf(stderr, "*** rpmts_Run(%p) ts %p ignore %x\n", s, s->ts, s->ignoreSet);
list = PyList_New(0);
return list;
} else if (!rc) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
list = PyList_New(0);
@@ -1033,8 +1024,7 @@ fprintf(stderr, "*** rpmts_Next(%p) ts %p\n", s, s->ts);
result = rpmts_iternext(s);
if (result == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
return result;