mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
|
@ -1382,10 +1382,8 @@ PyLong_AsLongLongAndOverflow(PyObject *vv, int *overflow)
|
|||
|
||||
#define CHECK_BINOP(v,w) \
|
||||
do { \
|
||||
if (!PyLong_Check(v) || !PyLong_Check(w)) { \
|
||||
Py_INCREF(Py_NotImplemented); \
|
||||
return Py_NotImplemented; \
|
||||
} \
|
||||
if (!PyLong_Check(v) || !PyLong_Check(w)) \
|
||||
Py_RETURN_NOTIMPLEMENTED; \
|
||||
} while(0)
|
||||
|
||||
/* bits_in_digit(d) returns the unique integer k such that 2**(k-1) <= d <
|
||||
|
@ -3611,8 +3609,7 @@ long_pow(PyObject *v, PyObject *w, PyObject *x)
|
|||
else {
|
||||
Py_DECREF(a);
|
||||
Py_DECREF(b);
|
||||
Py_INCREF(Py_NotImplemented);
|
||||
return Py_NotImplemented;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
if (Py_SIZE(b) < 0) { /* if exponent is negative */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue