[3.12] gh-114685: Fix incorrect use of PyBUF_READ in import.c (GH-114686) (GH-114700)

(cherry picked from commit 1ac1b2f953)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
Miss Islington (bot) 2024-01-29 11:09:51 +01:00 committed by GitHub
parent 930f805e72
commit 2a1d2c8325
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3570,7 +3570,7 @@ _imp_get_frozen_object_impl(PyObject *module, PyObject *name,
struct frozen_info info = {0};
Py_buffer buf = {0};
if (PyObject_CheckBuffer(dataobj)) {
if (PyObject_GetBuffer(dataobj, &buf, PyBUF_READ) != 0) {
if (PyObject_GetBuffer(dataobj, &buf, PyBUF_SIMPLE) != 0) {
return NULL;
}
info.data = (const char *)buf.buf;