mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
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:
parent
60e6e962ba
commit
228b12edcc
57 changed files with 225 additions and 445 deletions
|
@ -181,8 +181,7 @@ mmap_close_method(mmap_object *self, PyObject *unused)
|
|||
}
|
||||
#endif
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
#ifdef MS_WINDOWS
|
||||
|
@ -415,8 +414,7 @@ mmap_write_byte_method(mmap_object *self,
|
|||
|
||||
if (self->pos < self->size) {
|
||||
self->data[self->pos++] = value;
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PyExc_ValueError, "write byte out of range");
|
||||
|
@ -524,8 +522,7 @@ mmap_resize_method(mmap_object *self,
|
|||
new_size);
|
||||
if (self->data != NULL) {
|
||||
self->size = new_size;
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
Py_RETURN_NONE;
|
||||
} else {
|
||||
dwErrCode = GetLastError();
|
||||
CloseHandle(self->map_handle);
|
||||
|
@ -567,8 +564,7 @@ mmap_resize_method(mmap_object *self,
|
|||
}
|
||||
self->data = newmap;
|
||||
self->size = new_size;
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
Py_RETURN_NONE;
|
||||
#endif /* HAVE_MREMAP */
|
||||
#endif /* UNIX */
|
||||
}
|
||||
|
@ -644,8 +640,7 @@ mmap_seek_method(mmap_object *self, PyObject *args)
|
|||
if (where > self->size || where < 0)
|
||||
goto onoutofrange;
|
||||
self->pos = where;
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
onoutofrange:
|
||||
|
@ -670,8 +665,7 @@ mmap_move_method(mmap_object *self, PyObject *args)
|
|||
|
||||
memmove(&self->data[dest], &self->data[src], cnt);
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
Py_RETURN_NONE;
|
||||
|
||||
bounds:
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue