diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-04-04 17:09:35 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-04-04 17:09:35 (GMT) |
commit | e099b37428ab72cf70c745e941b9767fcad8eaa3 (patch) | |
tree | 11ba876743d835964f1b6a9cb52286d39326e54d /Modules | |
parent | f3abcc9d3c5c2a0bb739df2f3649ffa8b958a084 (diff) | |
download | cpython-e099b37428ab72cf70c745e941b9767fcad8eaa3.zip cpython-e099b37428ab72cf70c745e941b9767fcad8eaa3.tar.gz cpython-e099b37428ab72cf70c745e941b9767fcad8eaa3.tar.bz2 |
#5391 make mmap work exclusively with bytes
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/mmapmodule.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index b9c46cd..299eafd 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -204,7 +204,7 @@ mmap_read_byte_method(mmap_object *self, if (self->pos < self->size) { char value = self->data[self->pos]; self->pos += 1; - return Py_BuildValue("c", value); + return Py_BuildValue("b", value); } else { PyErr_SetString(PyExc_ValueError, "read byte out of range"); return NULL; @@ -264,7 +264,7 @@ mmap_gfind(mmap_object *self, Py_ssize_t len; CHECK_VALID(NULL); - if (!PyArg_ParseTuple(args, reverse ? "s#|nn:rfind" : "s#|nn:find", + if (!PyArg_ParseTuple(args, reverse ? "y#|nn:rfind" : "y#|nn:find", &needle, &len, &start, &end)) { return NULL; } else { @@ -348,7 +348,7 @@ mmap_write_method(mmap_object *self, char *data; CHECK_VALID(NULL); - if (!PyArg_ParseTuple(args, "s#:write", &data, &length)) + if (!PyArg_ParseTuple(args, "y#:write", &data, &length)) return(NULL); if (!is_writable(self)) @@ -371,7 +371,7 @@ mmap_write_byte_method(mmap_object *self, char value; CHECK_VALID(NULL); - if (!PyArg_ParseTuple(args, "c:write_byte", &value)) + if (!PyArg_ParseTuple(args, "b:write_byte", &value)) return(NULL); if (!is_writable(self)) |