Author: Amaury Forgeot d'Arc <[email protected]>
Branch: py3k
Changeset: r75768:23b481782927
Date: 2015-02-08 20:32 +0100
http://bitbucket.org/pypy/pypy/changeset/23b481782927/
Log: Fix various tests
diff --git a/lib_pypy/_ctypes/structure.py b/lib_pypy/_ctypes/structure.py
--- a/lib_pypy/_ctypes/structure.py
+++ b/lib_pypy/_ctypes/structure.py
@@ -180,7 +180,7 @@
if isinstance(address, _rawffi.StructureInstance):
address = address.buffer
# fix the address: turn it into as unsigned, in case it is negative
- address = address & (sys.maxint * 2 + 1)
+ address = address & (sys.maxsize * 2 + 1)
instance.__dict__['_buffer'] = self._ffistruct.fromaddress(address)
return instance
diff --git a/pypy/module/micronumpy/app_numpy.py
b/pypy/module/micronumpy/app_numpy.py
--- a/pypy/module/micronumpy/app_numpy.py
+++ b/pypy/module/micronumpy/app_numpy.py
@@ -18,7 +18,7 @@
length = int(length)
arr = _numpypy.multiarray.empty(length, dtype=dtype)
i = start
- for j in xrange(arr.size):
+ for j in range(arr.size):
arr[j] = i
i += step
return arr
diff --git a/pypy/objspace/std/test/test_dictmultiobject.py
b/pypy/objspace/std/test/test_dictmultiobject.py
--- a/pypy/objspace/std/test/test_dictmultiobject.py
+++ b/pypy/objspace/std/test/test_dictmultiobject.py
@@ -258,17 +258,17 @@
def test_reversed_dict(self):
import __pypy__
for d in [{}, {1: 2, 3: 4, 5: 6}, {"a": 5, "b": 2, "c": 6}]:
- assert list(__pypy__.reversed_dict(d)) == d.keys()[::-1]
+ assert list(__pypy__.reversed_dict(d)) == list(d.keys())[::-1]
raises(TypeError, __pypy__.reversed_dict, 42)
def test_reversed_dict_runtimeerror(self):
import __pypy__
d = {1: 2, 3: 4, 5: 6}
it = __pypy__.reversed_dict(d)
- key = it.next()
+ key = next(it)
assert key in [1, 3, 5]
del d[key]
- raises(RuntimeError, it.next)
+ raises(RuntimeError, next, it)
def test_keys(self):
d = {1: 2, 3: 4}
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit