summaryrefslogtreecommitdiffstats
path: root/Modules/mmapmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-07-26 18:28:23 (GMT)
committerGuido van Rossum <guido@python.org>2007-07-26 18:28:23 (GMT)
commite5aeaad0ca1f86462df0c9d2661a5970c7cca0b3 (patch)
tree04494d3b4a2611122e3904c96e0958854b58d2ea /Modules/mmapmodule.c
parent1eb79cfd6dfc5bb96a180fefc871fa1dc600a510 (diff)
downloadcpython-e5aeaad0ca1f86462df0c9d2661a5970c7cca0b3.zip
cpython-e5aeaad0ca1f86462df0c9d2661a5970c7cca0b3.tar.gz
cpython-e5aeaad0ca1f86462df0c9d2661a5970c7cca0b3.tar.bz2
Return bytes, not string from read(). Makes test_mmap.py pass.
Diffstat (limited to 'Modules/mmapmodule.c')
-rw-r--r--Modules/mmapmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index 29f458f..269ac90 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -226,7 +226,7 @@ mmap_read_method(mmap_object *self,
if ((self->pos + num_bytes) > self->size) {
num_bytes -= (self->pos+num_bytes) - self->size;
}
- result = Py_BuildValue("s#", self->data+self->pos, num_bytes);
+ result = PyBytes_FromStringAndSize(self->data+self->pos, num_bytes);
self->pos += num_bytes;
return result;
}