Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r52768:75870d03aa4f
Date: 2012-02-22 18:51 +0100
http://bitbucket.org/pypy/pypy/changeset/75870d03aa4f/

Log:    Can't use a "for" loop around a jit_merge_point.

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
@@ -79,11 +79,13 @@
                                                    'dtype', 's', 'a'])
 
 def fromstring_loop(a, count, dtype, itemsize, s):
-    for i in range(count):
+    i = 0
+    while i < count:
         fromstring_driver.jit_merge_point(a=a, count=count, dtype=dtype,
                                           itemsize=itemsize, s=s, i=i)
         val = dtype.itemtype.runpack_str(s[i*itemsize:i*itemsize + itemsize])
         a.dtype.setitem(a.storage, i, val)
+        i += 1
 
 @unwrap_spec(s=str, count=int, sep=str)
 def fromstring(space, s, w_dtype=None, count=-1, sep=''):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to