[pypy-commit] pypy numpy-fancy-indexing: relax the test and fix

fijal noreply at buildbot.pypy.org
Wed Sep 19 14:09:54 CEST 2012


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: numpy-fancy-indexing
Changeset: r57383:fccb6bd5800a
Date: 2012-09-19 14:09 +0200
http://bitbucket.org/pypy/pypy/changeset/fccb6bd5800a/

Log:	relax the test and fix

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
@@ -296,7 +296,7 @@
                 return self.get_scalar_value().item(space)
             if self.get_size() == 1:
                 w_obj = self.getitem(space,
-                                     [0] * range(len(self.get_shape())))
+                                     [0] * len(self.get_shape()))
                 assert isinstance(w_obj, interp_boxes.W_GenericBox)
                 return w_obj.item(space)
             raise OperationError(space.w_IndexError,
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
@@ -1965,7 +1965,7 @@
         assert (a.compress([1, 0, 13.5]) == [0, 2]).all()
         a = arange(10).reshape(2, 5)
         assert (a.compress([True, False, True]) == [0, 2]).all()
-        raises(IndexError, "a.compress([1] * 100)")
+        raises((IndexError, ValueError), "a.compress([1] * 100)")
 
     def test_item(self):
         from _numpypy import array


More information about the pypy-commit mailing list