mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
At least one of the buildbots was complaining about newview being used
without being initialized. Also make the code conform to the comment and return the new object. This code needs a test!
This commit is contained in:
parent
e43bd62b87
commit
b35f128711
1 changed files with 2 additions and 3 deletions
|
|
@ -513,12 +513,11 @@ memory_subscript(PyMemoryViewObject *self, PyObject *key)
|
|||
else {
|
||||
/* Return a new memory-view object */
|
||||
Py_buffer newview;
|
||||
PyMemoryView_FromMemory(&newview);
|
||||
memset(&newview, 0, sizeof(newview));
|
||||
return PyMemoryView_FromMemory(&newview);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Py_INCREF(Py_NotImplemented);
|
||||
return Py_NotImplemented;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue