diff options
author | Travis Oliphant <oliphant@enthought.com> | 2005-10-07 00:06:47 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2005-10-07 00:06:47 +0000 |
commit | d52d900dc6551e59cd679365723ff8e1dd7dfd9e (patch) | |
tree | bffc3b4a80f0a3dfffd404a9eff90b8a3f0c3c0f /scipy/base/src/arrayobject.c | |
parent | c2871a8b8b80fc3505195b179baa1472d46e063f (diff) | |
download | numpy-d52d900dc6551e59cd679365723ff8e1dd7dfd9e.tar.gz |
Fixed issues with threading...
Diffstat (limited to 'scipy/base/src/arrayobject.c')
-rw-r--r-- | scipy/base/src/arrayobject.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scipy/base/src/arrayobject.c b/scipy/base/src/arrayobject.c index 931bac6a5..f52f2c9c3 100644 --- a/scipy/base/src/arrayobject.c +++ b/scipy/base/src/arrayobject.c @@ -1675,8 +1675,16 @@ array_subscript(PyArrayObject *self, PyObject *op) value = PyArray_PyIntAsIntp(op); if (PyErr_Occurred()) PyErr_Clear(); - else if ((value <= MAX_INT) || (value >= -MAX_INT)) - return array_item(self, (int) value); + else if (value >= 0) { + if (value <= MAX_INT) + return array_item(self, (int) value); + } + else if (value < 0) { + if (value >= -MAX_INT) { + if (self->nd > 0) value += self->dimensions[0]; + return array_item(self, (int) value); + } + } } if (PyArrayMapIter_Check(op)) { |