Author: Philip Jenvey <pjen...@underboss.org>
Branch: py3k
Changeset: r83674:8c9c137475bb
Date: 2016-04-14 17:16 -0700
http://bitbucket.org/pypy/pypy/changeset/8c9c137475bb/

Log:    fix range check thinko; calculate w/ bits not bytes (grafted from
        3d517af7182117c996f1ddb710c5b34386465d30)

diff --git a/pypy/module/array/test/test_array.py 
b/pypy/module/array/test/test_array.py
--- a/pypy/module/array/test/test_array.py
+++ b/pypy/module/array/test/test_array.py
@@ -79,12 +79,13 @@
 
         for tc in 'BHIL':
             a = self.array(tc)
-            vals = [0, 2 ** a.itemsize - 1]
+            itembits = a.itemsize * 8
+            vals = [0, 2 ** itembits - 1]
             a.fromlist(vals)
             assert a.tolist() == vals
 
             a = self.array(tc.lower())
-            vals = [-1 * (2 ** a.itemsize) // 2,  (2 ** a.itemsize) // 2 - 1]
+            vals = [-1 * (2 ** itembits) // 2,  (2 ** itembits) // 2 - 1]
             a.fromlist(vals)
             assert a.tolist() == vals
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to