summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite
diff options
context:
space:
mode:
authorBrian Curtin <brian@python.org>2011-08-11 01:28:54 (GMT)
committerBrian Curtin <brian@python.org>2011-08-11 01:28:54 (GMT)
commitdfc80e3d97680ee26e509daba4a08502fefe22ee (patch)
treef28c4978ce126c4308a45aa594f0f2c86dfc1965 /Modules/_sqlite
parent7d2f9e13424fe74814e14cf92d7bbd779917a5c5 (diff)
downloadcpython-dfc80e3d97680ee26e509daba4a08502fefe22ee.zip
cpython-dfc80e3d97680ee26e509daba4a08502fefe22ee.tar.gz
cpython-dfc80e3d97680ee26e509daba4a08502fefe22ee.tar.bz2
Replace Py_NotImplemented returns with the macro form Py_RETURN_NOTIMPLEMENTED.
The macro was introduced in #12724.
Diffstat (limited to 'Modules/_sqlite')
-rw-r--r--Modules/_sqlite/row.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/Modules/_sqlite/row.c b/Modules/_sqlite/row.c
index 3d44094..b50658c 100644
--- a/Modules/_sqlite/row.c
+++ b/Modules/_sqlite/row.c
@@ -173,10 +173,9 @@ static Py_hash_t pysqlite_row_hash(pysqlite_Row *self)
static PyObject* pysqlite_row_richcompare(pysqlite_Row *self, PyObject *_other, int opid)
{
- if (opid != Py_EQ && opid != Py_NE) {
- Py_INCREF(Py_NotImplemented);
- return Py_NotImplemented;
- }
+ if (opid != Py_EQ && opid != Py_NE)
+ Py_RETURN_NOTIMPLEMENTED;
+
if (PyType_IsSubtype(Py_TYPE(_other), &pysqlite_RowType)) {
pysqlite_Row *other = (pysqlite_Row *)_other;
PyObject *res = PyObject_RichCompare(self->description, other->description, opid);
@@ -186,8 +185,7 @@ static PyObject* pysqlite_row_richcompare(pysqlite_Row *self, PyObject *_other,
return PyObject_RichCompare(self->data, other->data, opid);
}
}
- Py_INCREF(Py_NotImplemented);
- return Py_NotImplemented;
+ Py_RETURN_NOTIMPLEMENTED;
}
PyMappingMethods pysqlite_row_as_mapping = {