diff options
author | Travis Oliphant <oliphant@enthought.com> | 2005-12-13 05:33:13 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2005-12-13 05:33:13 +0000 |
commit | f0995b54db038fa8e1ecfecf51c2519e48e10043 (patch) | |
tree | 456bd1ad7f3817ea948004305812b73094d749e6 /scipy/base/src/arraymethods.c | |
parent | aea56a2d4c50cbedd4591aa970c1ac2578666d5a (diff) | |
download | numpy-f0995b54db038fa8e1ecfecf51c2519e48e10043.tar.gz |
Fixed array pickle to handle subclasses.
Diffstat (limited to 'scipy/base/src/arraymethods.c')
-rw-r--r-- | scipy/base/src/arraymethods.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/scipy/base/src/arraymethods.c b/scipy/base/src/arraymethods.c index 0cca98896..089aedf23 100644 --- a/scipy/base/src/arraymethods.c +++ b/scipy/base/src/arraymethods.c @@ -863,19 +863,18 @@ array_reduce(PyArrayObject *self, PyObject *args) ret = PyTuple_New(3); if (ret == NULL) return NULL; - mod = PyImport_ImportModule("scipy.base.multiarray"); + mod = PyImport_ImportModule("scipy.base._internal"); if (mod == NULL) {Py_DECREF(ret); return NULL;} - obj = PyObject_GetAttrString(mod, "empty"); + obj = PyObject_GetAttrString(mod, "_reconstruct"); Py_DECREF(mod); - if (obj == NULL) {Py_DECREF(ret); return NULL;} PyTuple_SET_ITEM(ret, 0, obj); PyTuple_SET_ITEM(ret, 1, - Py_BuildValue("NNN", + Py_BuildValue("ONN", + (PyObject *)self->ob_type, Py_BuildValue("(N)", PyInt_FromLong(0)), PyObject_GetAttrString((PyObject *)self, - "dtypechar"), - PyInt_FromLong((long) self->descr->elsize))); + "dtypechar"))); /* Now fill in object's state. This is a tuple with 4 arguments |