mirror of
https://github.com/python/cpython.git
synced 2025-12-08 02:08:20 +00:00
merge 3.5
This commit is contained in:
commit
43441c77b5
1 changed files with 3 additions and 1 deletions
|
|
@ -383,8 +383,10 @@ mmap_write_method(mmap_object *self,
|
||||||
if (!PyArg_ParseTuple(args, "y*:write", &data))
|
if (!PyArg_ParseTuple(args, "y*:write", &data))
|
||||||
return(NULL);
|
return(NULL);
|
||||||
|
|
||||||
if (!is_writable(self))
|
if (!is_writable(self)) {
|
||||||
|
PyBuffer_Release(&data);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (self->pos > self->size || self->size - self->pos < data.len) {
|
if (self->pos > self->size || self->size - self->pos < data.len) {
|
||||||
PyBuffer_Release(&data);
|
PyBuffer_Release(&data);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue