Author: Matti Picus <[email protected]>
Branch:
Changeset: r58376:c50358f493a3
Date: 2012-10-22 23:16 +0200
http://bitbucket.org/pypy/pypy/changeset/c50358f493a3/
Log: test, fix for 'take' raising exception
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
@@ -307,7 +307,8 @@
def descr_take(self, space, w_obj, w_axis=None, w_out=None):
# if w_axis is None and w_out is Nont this is an equivalent to
# fancy indexing
- raise Exception("unsupported for now")
+ raise OperationError(space.w_NotImplementedError,
+ space.wrap("unsupported for now"))
if not space.is_none(w_axis):
raise OperationError(space.w_NotImplementedError,
space.wrap("axis unsupported for take"))
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
@@ -1961,8 +1961,11 @@
assert (arange(6).reshape(2, 3).T.ravel() == [0, 3, 1, 4, 2, 5]).all()
def test_take(self):
- skip("we wait for int-based indexing")
from _numpypy import arange
+ try:
+ arange(10).take([0])
+ except NotImplementedError:
+ skip("we wait for int-based indexing")
assert (arange(10).take([1, 2, 1, 1]) == [1, 2, 1, 1]).all()
raises(IndexError, "arange(3).take([15])")
a = arange(6).reshape(2, 3)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit