diff Modules/_sqlite/row.c @ 71810:d0b0fcbb40db

Replace Py_NotImplemented returns with the macro form Py_RETURN_NOTIMPLEMENTED. The macro was introduced in #12724.
author Brian Curtin <brian@python.org>
date Wed, 10 Aug 2011 20:28:54 -0500
parents 51959f39a7fb
children a04d957c8d07
line wrap: on
line diff
--- a/Modules/_sqlite/row.c	Wed Aug 10 20:05:21 2011 -0500
+++ b/Modules/_sqlite/row.c	Wed Aug 10 20:28:54 2011 -0500
@@ -173,10 +173,9 @@
 
 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 @@
             return PyObject_RichCompare(self->data, other->data, opid);
         }
     }
-    Py_INCREF(Py_NotImplemented);
-    return Py_NotImplemented;
+    Py_RETURN_NOTIMPLEMENTED;
 }
 
 PyMappingMethods pysqlite_row_as_mapping = {