summaryrefslogtreecommitdiffstats
path: root/Objects/memoryobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/memoryobject.c')
-rw-r--r--Objects/memoryobject.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c
index 9a62dd8..3f20392 100644
--- a/Objects/memoryobject.c
+++ b/Objects/memoryobject.c
@@ -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;