summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
authorJarl Haggerty <jarl@covetouscat.com>2014-09-27 16:08:15 -0400
committerCharles Harris <charlesr.harris@gmail.com>2014-10-21 17:40:30 -0600
commit892c46910c7f9f0211f01b42f9aa81d0db892c8e (patch)
tree67f3abab6a67707871c4ec8331d280b7f5dc88a2 /numpy/core
parent2f1e27610453f901e81cd892b2aa3b3a2ac30819 (diff)
downloadnumpy-892c46910c7f9f0211f01b42f9aa81d0db892c8e.tar.gz
BUG: Make PyArray_PutTo respect writeable flag.
Closes #4465.
Diffstat (limited to 'numpy/core')
-rw-r--r--numpy/core/src/multiarray/item_selection.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/item_selection.c b/numpy/core/src/multiarray/item_selection.c
index b2bf17f4c..cd0ae1680 100644
--- a/numpy/core/src/multiarray/item_selection.c
+++ b/numpy/core/src/multiarray/item_selection.c
@@ -265,6 +265,11 @@ PyArray_PutTo(PyArrayObject *self, PyObject* values0, PyObject *indices0,
"put: first argument must be an array");
return NULL;
}
+
+ if (PyArray_FailUnlessWriteable(self, "put: output array") < 0) {
+ return NULL;
+ }
+
if (!PyArray_ISCONTIGUOUS(self)) {
PyArrayObject *obj;
int flags = NPY_ARRAY_CARRAY | NPY_ARRAY_UPDATEIFCOPY;