Issue #9737: Fix a crash when trying to delete a slice or an item from

a memoryview object.
This commit is contained in:
Antoine Pitrou 2010-09-01 21:14:16 +00:00
parent 6cb5ad035b
commit e0793ba992
3 changed files with 17 additions and 0 deletions

View file

@ -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;