Replace Py_NotImplemented returns with the macro form Py_RETURN_NOTIMPLEMENTED.

The macro was introduced in #12724.
This commit is contained in:
Brian Curtin 2011-08-10 20:28:54 -05:00
parent 7d2f9e1342
commit dfc80e3d97
24 changed files with 87 additions and 162 deletions

View file

@ -4925,10 +4925,9 @@ cpu_set_richcompare(Py_cpu_set *set, Py_cpu_set *other, int op)
{
int eq;
if ((op != Py_EQ && op != Py_NE) || Py_TYPE(other) != &cpu_set_type) {
Py_INCREF(Py_NotImplemented);
return Py_NotImplemented;
}
if ((op != Py_EQ && op != Py_NE) || Py_TYPE(other) != &cpu_set_type)
Py_RETURN_NOTIMPLEMENTED;
eq = set->ncpus == other->ncpus && CPU_EQUAL_S(set->size, set->set, other->set);
if ((op == Py_EQ) ? eq : !eq)
Py_RETURN_TRUE;
@ -4949,8 +4948,7 @@ cpu_set_richcompare(Py_cpu_set *set, Py_cpu_set *other, int op)
} \
if (Py_TYPE(right) != &cpu_set_type || left->ncpus != right->ncpus) { \
Py_DECREF(res); \
Py_INCREF(Py_NotImplemented); \
return Py_NotImplemented; \
Py_RETURN_NOTIMPLEMENTED; \
} \
assert(left->size == right->size && right->size == res->size); \
op(res->size, res->set, left->set, right->set); \