Skip to content

Commit

Permalink
Fix numpy array writable flag setter.
Browse files Browse the repository at this point in the history
Refs #9421
  • Loading branch information
martyngigg committed May 8, 2014
1 parent 960708a commit c1e6b6c
Showing 1 changed file with 1 addition and 3 deletions.
Expand Up @@ -28,9 +28,7 @@ namespace Mantid { namespace PythonInterface
void markReadOnly(PyArrayObject *arr)
{
#if NPY_API_VERSION >= 0x00000007 //(1.7)
// this is how they do it in ndarrayobject.h:PyArray_XDECREF_ERR
PyArrayObject *base = (PyArrayObject*)PyArray_BASE(arr);
PyArray_CLEARFLAGS(base, NPY_ARRAY_WRITEABLE);
PyArray_CLEARFLAGS(arr, NPY_ARRAY_WRITEABLE);
#else
arr->flags &= ~NPY_WRITEABLE;
#endif
Expand Down

0 comments on commit c1e6b6c

Please sign in to comment.