aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Modules/mmapmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/mmapmodule.c')
-rw-r--r--Modules/mmapmodule.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index bb98a994275..50cec2498d8 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -389,6 +389,7 @@ mmap_write_method(mmap_object *self,
PyObject *args)
{
Py_buffer data;
+ PyObject *result;
CHECK_VALID(NULL);
if (!PyArg_ParseTuple(args, "y*:write", &data))
@@ -406,9 +407,9 @@ mmap_write_method(mmap_object *self,
}
memcpy(self->data + self->pos, data.buf, data.len);
self->pos = self->pos + data.len;
+ result = PyLong_FromSsize_t(data.len);
PyBuffer_Release(&data);
- Py_INCREF(Py_None);
- return Py_None;
+ return result;
}
static PyObject *