1. Alex Prengère
  2. pypy

Commits

Maciej Fijalkowski  committed fccb6bd

relax the test and fix

  • Participants
  • Parent commits 4d0afc7
  • Branches numpy-fancy-indexing

Comments (0)

Files changed (2)

File pypy/module/micronumpy/interp_numarray.py

View file
  • Ignore whitespace
                 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,

File pypy/module/micronumpy/test/test_numarray.py

View file
  • Ignore whitespace
         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