Author: Maciej Fijalkowski <[email protected]>
Branch: numpy-multidim-shards
Changeset: r49573:3f7e25afec9d
Date: 2011-11-20 12:23 +0200
http://bitbucket.org/pypy/pypy/changeset/3f7e25afec9d/

Log:    more rpythonization (and potential crash avoidance)

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
@@ -471,10 +471,11 @@
         Multidimensional arrays/slices will span a number of lines,
         each line will begin with indent.
         '''
-        if self.size < 1:
+        size = self.find_size()
+        if size < 1:
             builder.append('[]')
             return
-        if self.size > 1000:
+        if size > 1000:
             #Once this goes True it does not go back to False for recursive 
calls
             use_ellipsis = True
         dtype = self.find_dtype()
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to