diff options
author | Travis Oliphant <oliphant@enthought.com> | 2008-04-30 16:01:25 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2008-04-30 16:01:25 +0000 |
commit | 233af718df4cf92bad9b93993e11faba5b6fff26 (patch) | |
tree | 4584e641b1d95b0025efc077a956993fa2b348da | |
parent | 59e7bda0f6d189428b7268e0150709bacde8544b (diff) | |
download | numpy-233af718df4cf92bad9b93993e11faba5b6fff26.tar.gz |
Check for error and fix spacing.
-rw-r--r-- | numpy/core/src/multiarraymodule.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/numpy/core/src/multiarraymodule.c b/numpy/core/src/multiarraymodule.c index 135998830..d08b3fd76 100644 --- a/numpy/core/src/multiarraymodule.c +++ b/numpy/core/src/multiarraymodule.c @@ -3458,6 +3458,7 @@ PyArray_CopyAndTranspose(PyObject *op) /* make sure it is well-behaved */ arr = PyArray_FromAny(op, NULL, 0, 0, CARRAY, NULL); + if (arr == NULL) return NULL; nd = PyArray_NDIM(arr); if (nd == 1) { /* we will give in to old behavior */ ret = PyArray_Copy((PyArrayObject *)arr); @@ -3488,7 +3489,7 @@ PyArray_CopyAndTranspose(PyObject *op) } /* do 2-d loop */ NPY_BEGIN_ALLOW_THREADS; - optr = PyArray_DATA(ret); + optr = PyArray_DATA(ret); str2 = elsize*dims[0]; for (i=0; i<dims[0]; i++) { iptr = PyArray_BYTES(arr) + i*elsize; @@ -3500,7 +3501,7 @@ PyArray_CopyAndTranspose(PyObject *op) } } NPY_END_ALLOW_THREADS; - Py_DECREF(arr); + Py_DECREF(arr); return ret; } |