Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e5aeaad

Browse files
committed
Return bytes, not string from read(). Makes test_mmap.py pass.
1 parent 1eb79cf commit e5aeaad

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Modules/mmapmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ mmap_read_method(mmap_object *self,
226226
if ((self->pos + num_bytes) > self->size) {
227227
num_bytes -= (self->pos+num_bytes) - self->size;
228228
}
229-
result = Py_BuildValue("s#", self->data+self->pos, num_bytes);
229+
result = PyBytes_FromStringAndSize(self->data+self->pos, num_bytes);
230230
self->pos += num_bytes;
231231
return result;
232232
}

0 commit comments

Comments
 (0)