From e5aeaad0ca1f86462df0c9d2661a5970c7cca0b3 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 26 Jul 2007 18:28:23 +0000 Subject: Return bytes, not string from read(). Makes test_mmap.py pass. --- Modules/mmapmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v0.12