diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-06-12 20:50:59 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-06-12 20:50:59 +0000 |
commit | cc961e3f6758e563be1bf3bf25ed5e6367036e65 (patch) | |
tree | 1fb39a0dfcca995efebfee45423c9a45bcd2d68d | |
parent | c0d32936d1991a2cd8a75b21b805777c18be66e9 (diff) | |
download | numpy-cc961e3f6758e563be1bf3bf25ed5e6367036e65.tar.gz |
Fix ticket #140 where objects in a field could be specified but resulted in segfaults.
-rw-r--r-- | numpy/core/src/multiarraymodule.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/numpy/core/src/multiarraymodule.c b/numpy/core/src/multiarraymodule.c index 5537e83c5..3d147c47a 100644 --- a/numpy/core/src/multiarraymodule.c +++ b/numpy/core/src/multiarraymodule.c @@ -3671,12 +3671,6 @@ _use_inherit(PyArray_Descr *type, PyObject *newobj, int *errflag) return NULL; } *errflag = 1; - if (type == &OBJECT_Descr) { - PyErr_SetString(PyExc_ValueError, - "cannot base a new descriptor on an"\ - " OBJECT descriptor."); - goto fail; - } new = PyArray_DescrNew(type); if (new == NULL) goto fail; @@ -3692,6 +3686,8 @@ _use_inherit(PyArray_Descr *type, PyObject *newobj, int *errflag) Py_XINCREF(new->fields); } Py_DECREF(conv); + if (conv->hasobject) + new->hasobject = 1; *errflag = 0; return new; |