summaryrefslogtreecommitdiff
path: root/numpy/core/src
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-01-11 07:18:26 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-01-11 07:18:26 +0000
commit2ea2a8751198880820adaebd55f4e0f1979aeaea (patch)
tree7344fb88a5afdd91259ec582c1efe14723bd9b45 /numpy/core/src
parent45c7e2bb8135146245b5a980560e4d0a2b3a7868 (diff)
downloadnumpy-2ea2a8751198880820adaebd55f4e0f1979aeaea.tar.gz
Change the order of attribute lookup for object array types.
Diffstat (limited to 'numpy/core/src')
-rw-r--r--numpy/core/src/scalartypes.inc.src13
1 files changed, 7 insertions, 6 deletions
diff --git a/numpy/core/src/scalartypes.inc.src b/numpy/core/src/scalartypes.inc.src
index 140e67249..2a8fcf4a9 100644
--- a/numpy/core/src/scalartypes.inc.src
+++ b/numpy/core/src/scalartypes.inc.src
@@ -1849,23 +1849,24 @@ void_arrtype_hash(PyObject *obj)
static PyObject *
object_arrtype_getattro(PyObjectScalarObject *obj, PyObject *attr) {
PyObject *res;
- /* first look in generic type and then hand off to actual object */
- res = PyObject_GenericGetAttr((PyObject *)obj, attr);
+ /* first look in object and then hand off to generic type */
+
+ res = PyObject_GenericGetAttr(obj->obval, attr);
if (res) return res;
PyErr_Clear();
- return PyObject_GenericGetAttr(obj->obval, attr);
+ return PyObject_GenericGetAttr((PyObject *)obj, attr);
}
static int
object_arrtype_setattro(PyObjectScalarObject *obj, PyObject *attr, PyObject *val) {
int res;
- /* first look in generic type and then hand off to actual object */
+ /* first look in object and then hand off to generic type */
- res = PyObject_GenericSetAttr((PyObject *)obj, attr, val);
+ res = PyObject_GenericSetAttr(obj->obval, attr, val);
if (res >= 0) return res;
PyErr_Clear();
- return PyObject_GenericSetAttr(obj->obval, attr, val);
+ return PyObject_GenericSetAttr((PyObject *)obj, attr, val);
}
static int