mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Issue #9737: Fix a crash when trying to delete a slice or an item from
a memoryview object.
This commit is contained in:
parent
6cb5ad035b
commit
e0793ba992
3 changed files with 17 additions and 0 deletions
|
|
@ -631,6 +631,11 @@ memory_ass_sub(PyMemoryViewObject *self, PyObject *key, PyObject *value)
|
|||
"cannot modify read-only memory");
|
||||
return -1;
|
||||
}
|
||||
if (value == NULL) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"cannot delete memory");
|
||||
return -1;
|
||||
}
|
||||
if (view->ndim != 1) {
|
||||
PyErr_SetNone(PyExc_NotImplementedError);
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue