Mercurial > cpython-lru_cache-weakref
diff Python/marshal.c @ 49057:8ffec372040e
fixes deferred/release blocker issue #3797: Fixed the dbm, marshal, mmap,
ossaudiodev, & winreg modules to return bytes objects instead of bytearray
objects.
| author | Gregory P. Smith <greg@mad-scientist.com> |
|---|---|
| date | Sat, 06 Sep 2008 21:34:51 +0000 |
| parents | cd3b0b7fd8e1 |
| children | 2d6ff4a94953 4e927faf30ea |
line wrap: on
line diff
--- a/Python/marshal.c Sat Sep 06 21:03:22 2008 +0000 +++ b/Python/marshal.c Sat Sep 06 21:34:51 2008 +0000 @@ -1093,7 +1093,7 @@ } 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 @@ 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,
