fixes deferred/release blocker issue #3797: Fixed the dbm, marshal, mmap,
ossaudiodev, & winreg modules to return bytes objects instead of bytearray
objects.
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index 9adef9b..6a2ebfd 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -228,7 +228,7 @@
else
++eol; /* we're interested in the position after the
newline. */
- result = PyByteArray_FromStringAndSize(start, (eol - start));
+ result = PyBytes_FromStringAndSize(start, (eol - start));
self->pos += (eol - start);
return result;
}
@@ -248,7 +248,7 @@
if (num_bytes > self->size - self->pos) {
num_bytes -= (self->pos+num_bytes) - self->size;
}
- result = PyByteArray_FromStringAndSize(self->data+self->pos, num_bytes);
+ result = PyBytes_FromStringAndSize(self->data+self->pos, num_bytes);
self->pos += num_bytes;
return result;
}
@@ -679,7 +679,7 @@
PyErr_SetString(PyExc_IndexError, "mmap index out of range");
return NULL;
}
- return PyByteArray_FromStringAndSize(self->data + i, 1);
+ return PyBytes_FromStringAndSize(self->data + i, 1);
}
static PyObject *
@@ -769,14 +769,14 @@
"mmap object doesn't support item deletion");
return -1;
}
- if (! (PyByteArray_Check(v) && PyByteArray_Size(v)==1) ) {
+ if (! (PyBytes_Check(v) && PyBytes_Size(v)==1) ) {
PyErr_SetString(PyExc_IndexError,
"mmap assignment must be length-1 bytes()");
return -1;
}
if (!is_writable(self))
return -1;
- buf = PyByteArray_AsString(v);
+ buf = PyBytes_AsString(v);
self->data[i] = buf[0];
return 0;
}