[pypy-commit] pypy default: ups, this is enough
fijal
noreply at buildbot.pypy.org
Mon Oct 1 21:50:43 CEST 2012
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch:
Changeset: r57707:7f6d5c878b90
Date: 2012-10-01 21:50 +0200
http://bitbucket.org/pypy/pypy/changeset/7f6d5c878b90/
Log: ups, this is enough
diff --git a/pypy/module/micronumpy/interp_numarray.py b/pypy/module/micronumpy/interp_numarray.py
--- a/pypy/module/micronumpy/interp_numarray.py
+++ b/pypy/module/micronumpy/interp_numarray.py
@@ -129,7 +129,7 @@
self._prepare_array_index(space, w_index)
shape = res_shape + self.get_shape()[len(indexes):]
res = W_NDimArray.from_shape(shape, self.get_dtype(), self.get_order())
- if not self.get_size() and not res.get_size():
+ if not res.get_size():
return res
return loop.getitem_array_int(space, self, res, iter_shape, indexes,
prefix)
diff --git a/pypy/module/micronumpy/test/test_numarray.py b/pypy/module/micronumpy/test/test_numarray.py
--- a/pypy/module/micronumpy/test/test_numarray.py
+++ b/pypy/module/micronumpy/test/test_numarray.py
@@ -1519,7 +1519,7 @@
assert (a == [1, 1]).all()
def test_int_array_index(self):
- from numpypy import array, arange
+ from numpypy import array, arange, zeros
b = arange(10)[array([3, 2, 1, 5])]
assert (b == [3, 2, 1, 5]).all()
raises(IndexError, "arange(10)[array([10])]")
@@ -1528,6 +1528,7 @@
a = arange(1)
a[[0, 0]] += 1
assert a[0] == 1
+ assert (zeros(1)[[]] == []).all()
def test_int_array_index_setitem(self):
from numpypy import array, arange, zeros
More information about the pypy-commit
mailing list