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

@ -7417,8 +7417,7 @@ PyUnicode_RichCompare(PyObject *left, PyObject *right, int op)
return v;
}
Py_INCREF(Py_NotImplemented);
return Py_NotImplemented;
Py_RETURN_NOTIMPLEMENTED;
}
int
@ -9291,10 +9290,8 @@ static PyMethodDef unicode_methods[] = {
static PyObject *
unicode_mod(PyObject *v, PyObject *w)
{
if (!PyUnicode_Check(v)) {
Py_INCREF(Py_NotImplemented);
return Py_NotImplemented;
}
if (!PyUnicode_Check(v))
Py_RETURN_NOTIMPLEMENTED;
return PyUnicode_Format(v, w);
}