mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
fixes deferred/release blocker issue #3797: Fixed the dbm, marshal, mmap,
ossaudiodev, & winreg modules to return bytes objects instead of bytearray objects.
This commit is contained in:
parent
7e958d1ceb
commit
0a608fdaac
6 changed files with 21 additions and 18 deletions
|
@ -1093,7 +1093,7 @@ PyMarshal_WriteObjectToString(PyObject *x, int version)
|
|||
}
|
||||
if (wf.str != NULL) {
|
||||
/* XXX Quick hack -- need to do this differently */
|
||||
res = PyByteArray_FromObject(wf.str);
|
||||
res = PyBytes_FromObject(wf.str);
|
||||
Py_DECREF(wf.str);
|
||||
}
|
||||
return res;
|
||||
|
@ -1134,9 +1134,9 @@ marshal_load(PyObject *self, PyObject *f)
|
|||
rf.ptr = PyBytes_AS_STRING(data);
|
||||
rf.end = rf.ptr + PyBytes_GET_SIZE(data);
|
||||
}
|
||||
else if (PyByteArray_Check(data)) {
|
||||
rf.ptr = PyByteArray_AS_STRING(data);
|
||||
rf.end = rf.ptr + PyByteArray_GET_SIZE(data);
|
||||
else if (PyBytes_Check(data)) {
|
||||
rf.ptr = PyBytes_AS_STRING(data);
|
||||
rf.end = rf.ptr + PyBytes_GET_SIZE(data);
|
||||
}
|
||||
else {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue