mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
Replace Py_NotImplemented returns with the macro form Py_RETURN_NOTIMPLEMENTED.
The macro was introduced in #12724.
This commit is contained in:
parent
7d2f9e1342
commit
dfc80e3d97
24 changed files with 87 additions and 162 deletions
|
@ -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); \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue