diff options
author | Brian Curtin <brian@python.org> | 2011-08-11 01:28:54 (GMT) |
---|---|---|
committer | Brian Curtin <brian@python.org> | 2011-08-11 01:28:54 (GMT) |
commit | dfc80e3d97680ee26e509daba4a08502fefe22ee (patch) | |
tree | f28c4978ce126c4308a45aa594f0f2c86dfc1965 /Modules/posixmodule.c | |
parent | 7d2f9e13424fe74814e14cf92d7bbd779917a5c5 (diff) | |
download | cpython-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/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 2be5ec9..d701690 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -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); \ |