[pypy-commit] pypy numpy_partition: fix for boxed value

mattip pypy.commits at gmail.com
Sat Mar 5 17:05:06 EST 2016


Author: mattip <matti.picus at gmail.com>
Branch: numpy_partition
Changeset: r82801:fc583e7eb11a
Date: 2016-03-06 00:03 +0200
http://bitbucket.org/pypy/pypy/changeset/fc583e7eb11a/

Log:	fix for boxed value

diff --git a/pypy/module/micronumpy/ndarray.py b/pypy/module/micronumpy/ndarray.py
--- a/pypy/module/micronumpy/ndarray.py
+++ b/pypy/module/micronumpy/ndarray.py
@@ -535,7 +535,8 @@
         l_w = []
         for i in range(self.get_shape()[0]):
             item_w = self.descr_getitem(space, space.wrap(i))
-            if isinstance(item_w, W_NDimArray):
+            if (isinstance(item_w, W_NDimArray) or 
+                    isinstance(item_w, boxes.W_GenericBox)):
                 l_w.append(space.call_method(item_w, "tolist"))
             else:
                 l_w.append(item_w)


More information about the pypy-commit mailing list