[pypy-commit] pypy numpy-ndarray: fix the bug, fix one other bug

alex_gaynor noreply at buildbot.pypy.org
Fri Dec 2 19:42:16 CET 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: numpy-ndarray
Changeset: r50074:2d3c7db968ec
Date: 2011-12-02 13:40 -0500
http://bitbucket.org/pypy/pypy/changeset/2d3c7db968ec/

Log:	fix the bug, fix one other bug

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
@@ -780,9 +780,7 @@
         return w_obj
     elif space.issequence_w(w_obj):
         # Convert to array.
-        w_obj = space.call_function(space.gettypefor(BaseArray), w_obj)
-        assert isinstance(w_obj, BaseArray)
-        return w_obj
+        return array(space, w_obj, w_order=None)
     else:
         # If it's a scalar
         dtype = interp_ufuncs.find_dtype_for_scalar(space, w_obj)
diff --git a/pypy/module/micronumpy/interp_support.py b/pypy/module/micronumpy/interp_support.py
--- a/pypy/module/micronumpy/interp_support.py
+++ b/pypy/module/micronumpy/interp_support.py
@@ -9,7 +9,7 @@
 
 @unwrap_spec(s=str)
 def fromstring(space, s):
-    from pypy.module.micronumpy.interp_numarray import NDimArray
+    from pypy.module.micronumpy.interp_numarray import W_NDimArray
     length = len(s)
 
     if length % FLOAT_SIZE == 0:
@@ -19,7 +19,7 @@
             "string length %d not divisable by %d" % (length, FLOAT_SIZE)))
 
     dtype = get_dtype_cache(space).w_float64dtype
-    a = NDimArray(number, [number], dtype=dtype)
+    a = W_NDimArray(number, [number], dtype=dtype)
 
     start = 0
     end = FLOAT_SIZE


More information about the pypy-commit mailing list