Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever

possible.  Patch is writen with Coccinelle.
This commit is contained in:
Serhiy Storchaka 2017-01-23 09:47:21 +02:00
parent 60e6e962ba
commit 228b12edcc
57 changed files with 225 additions and 445 deletions

View file

@ -1007,8 +1007,7 @@ ins(arrayobject *self, Py_ssize_t where, PyObject *v)
{
if (ins1(self, where, v) != 0)
return NULL;
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}
/*[clinic input]
@ -1122,8 +1121,7 @@ array_array_remove(arrayobject *self, PyObject *v)
if (cmp > 0) {
if (array_del_slice(self, i, i+1) != 0)
return NULL;
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}
else if (cmp < 0)
return NULL;
@ -1185,8 +1183,7 @@ array_array_extend(arrayobject *self, PyObject *bb)
{
if (array_do_extend(self, bb) == -1)
return NULL;
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}
/*[clinic input]
@ -1315,8 +1312,7 @@ array_array_byteswap_impl(arrayobject *self)
"don't know how to byteswap this array type");
return NULL;
}
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}
/*[clinic input]
@ -1349,8 +1345,7 @@ array_array_reverse_impl(arrayobject *self)
}
}
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}
/*[clinic input]
@ -1453,8 +1448,7 @@ array_array_tofile(arrayobject *self, PyObject *f)
}
done:
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}
/*[clinic input]
@ -1491,8 +1485,7 @@ array_array_fromlist(arrayobject *self, PyObject *list)
}
}
}
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}
/*[clinic input]
@ -1557,8 +1550,7 @@ frombytes(arrayobject *self, Py_buffer *buffer)
buffer->buf, n * itemsize);
}
PyBuffer_Release(buffer);
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}
/*[clinic input]