mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
[3.11] gh-114685: Fix incorrect use of PyBUF_READ in import.c (GH-114686) (GH-114701)
(cherry picked from commit 1ac1b2f953
)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
parent
9fd8aaab83
commit
ee3ca96359
1 changed files with 1 additions and 1 deletions
|
@ -2194,7 +2194,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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue