diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-07-08 02:21:36 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-07-08 02:21:36 +0000 |
commit | 3655a56c37385ced20042c871a4dcefb21ba971f (patch) | |
tree | 644b9aef75195fa935d8bd11945a3eb9395c8f45 /numpy/core/src/arrayobject.c | |
parent | 56d04a88ac47b7d5966aca68f081ba97e23c5e70 (diff) | |
download | numpy-3655a56c37385ced20042c871a4dcefb21ba971f.tar.gz |
Fix problem with CheckFromAny when descr is NULL
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r-- | numpy/core/src/arrayobject.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index 65ea47649..45c5c9ee0 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -7804,10 +7804,12 @@ PyArray_CheckFromAny(PyObject *op, PyArray_Descr *descr, int min_depth, !PyArray_ISNBO(PyArray_DESCR(op)->byteorder)) { descr = PyArray_DescrNew(PyArray_DESCR(op)); } - else if ((descr && !PyArray_ISNBO(descr->byteorder))) { + else if (descr && !PyArray_ISNBO(descr->byteorder)) { PyArray_DESCR_REPLACE(descr); - } - descr->byteorder = PyArray_NATIVE; + } + if (descr) { + descr->byteorder = PyArray_NATIVE; + } } obj = PyArray_FromAny(op, descr, min_depth, max_depth, |