summaryrefslogtreecommitdiff
path: root/numpy/core/src/arrayobject.c
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-10-05 05:49:08 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-10-05 05:49:08 +0000
commitc76a2c4097fda804b05a713370ce077215e2ee7a (patch)
tree2c26998cf02674723a86270c6de8d760f955322c /numpy/core/src/arrayobject.c
parentc620acddd34a07edd6f33baad0adfad6e8cf1bd5 (diff)
downloadnumpy-c76a2c4097fda804b05a713370ce077215e2ee7a.tar.gz
Fix up __array_interface__ getting and depth discovery for scalars.
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r--numpy/core/src/arrayobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c
index 03772199a..6e0c79d4c 100644
--- a/numpy/core/src/arrayobject.c
+++ b/numpy/core/src/arrayobject.c
@@ -6702,7 +6702,8 @@ discover_depth(PyObject *s, int max, int stop_at_string, int stop_at_tuple)
}
if (PyArray_Check(s))
return PyArray_NDIM(s);
- if(PyString_Check(s) || PyBuffer_Check(s) || PyUnicode_Check(s))
+ if (PyArray_IsScalar(s, Generic)) return 0;
+ if (PyString_Check(s) || PyBuffer_Check(s) || PyUnicode_Check(s))
return stop_at_string ? 0:1;
if (stop_at_tuple && PyTuple_Check(s)) return 0;
if ((e=PyObject_GetAttrString(s, "__array_interface__")) != NULL) {