diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-09-15 18:05:27 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-09-15 18:05:27 +0000 |
commit | a761817d410c96e93a413f6ad98de17cb20fbd6b (patch) | |
tree | 5bf18c77e3eb5a814aa0e36d707c3f2f04e0ead3 /numpy/core/src/arrayobject.c | |
parent | b3a5ff58124174ff9beab9118039b16db8a6b83d (diff) | |
download | numpy-a761817d410c96e93a413f6ad98de17cb20fbd6b.tar.gz |
Add DescrAlignConverter
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r-- | numpy/core/src/arrayobject.c | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index 417b12717..1a126e3e2 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -10729,32 +10729,10 @@ arraydescr_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) return NULL; if (align) { - conv = NULL; - if PyDict_Check(odescr) - conv = _convert_from_dict(odescr, 1); - else if PyList_Check(odescr) { - PyErr_SetString(PyExc_ValueError, - "align cannot be True" \ - " with array_descriptor " \ - "specification."); - return NULL; - } - else if PyString_Check(odescr) - conv = _convert_from_commastring(odescr, 1); - else { - PyErr_SetString(PyExc_ValueError, - "align can only be non-zero for " \ - "dictionary, list, and string objects."); - } - if (conv) return (PyObject *)conv; - if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ValueError, - "data-type-descriptor not understood"); - } - return NULL; + if (!PyArray_DescrAlignConverter(odescr, &conv)) + return NULL; } - - if (!PyArray_DescrConverter(odescr, &conv)) + else if (!PyArray_DescrConverter(odescr, &conv)) return NULL; /* Get a new copy of it unless it's already a copy */ if (copy && conv->fields == Py_None) { |