Replace Py_NotImplemented returns with the macro form Py_RETURN_NOTIMPLEMENTED.
The macro was introduced in #12724.
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 6df930f..b52a209 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -190,8 +190,7 @@
!PyMethod_Check(self) ||
!PyMethod_Check(other))
{
- Py_INCREF(Py_NotImplemented);
- return Py_NotImplemented;
+ Py_RETURN_NOTIMPLEMENTED;
}
a = (PyMethodObject *)self;
b = (PyMethodObject *)other;
@@ -516,8 +515,7 @@
!PyInstanceMethod_Check(self) ||
!PyInstanceMethod_Check(other))
{
- Py_INCREF(Py_NotImplemented);
- return Py_NotImplemented;
+ Py_RETURN_NOTIMPLEMENTED;
}
a = (PyInstanceMethodObject *)self;
b = (PyInstanceMethodObject *)other;