Author: Brian Kearns <[email protected]>
Branch: numpy-refactor
Changeset: r69478:32523cf4d763
Date: 2014-02-26 17:18 -0500
http://bitbucket.org/pypy/pypy/changeset/32523cf4d763/
Log: fix nonzero
diff --git a/pypy/module/micronumpy/concrete.py
b/pypy/module/micronumpy/concrete.py
--- a/pypy/module/micronumpy/concrete.py
+++ b/pypy/module/micronumpy/concrete.py
@@ -288,7 +288,7 @@
def nonzero(self, space, index_type):
s = loop.count_all_true_concrete(self)
box = index_type.itemtype.box
- nd = len(self.get_shape())
+ nd = len(self.get_shape()) or 1
w_res = W_NDimArray.from_shape(space, [s, nd], index_type)
loop.nonzero(w_res, self, box)
w_res = w_res.implementation.swapaxes(space, w_res, 0, 1)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit