Author: Ronan Lamy <ronan.l...@gmail.com> Branch: py3k Changeset: r85870:33a339e87938 Date: 2016-07-27 04:18 +0100 http://bitbucket.org/pypy/pypy/changeset/33a339e87938/
Log: fixes, 2to3 diff --git a/pypy/module/cpyext/test/array.c b/pypy/module/cpyext/test/array.c --- a/pypy/module/cpyext/test/array.c +++ b/pypy/module/cpyext/test/array.c @@ -2374,15 +2374,11 @@ int nn; int n = PyList_Size(obj1); PyObject *v = getarrayitem(obj2, 0); - int i = ((PyIntObject*)v)->ob_ival; PyObject * ret = PyList_New(n); for (nn = 0; nn < n; nn++) { v = PyList_GetItem(obj1, nn); - if (PyInt_Check(v)) - PyList_SetItem(ret, nn, PyLong_FromLong(i * ((PyIntObject*)v)->ob_ival)); - else - PyList_SetItem(ret, nn, v); + PyList_SetItem(ret, nn, v); } return ret; } @@ -2391,15 +2387,11 @@ int nn; int n = PyList_Size(obj2); PyObject *v = getarrayitem(obj1, 0); - int i = ((PyIntObject*)v)->ob_ival; PyObject * ret = PyList_New(n); for (nn = 0; nn < n; nn++) { v = PyList_GetItem(obj2, nn); - if (PyInt_Check(v)) - PyList_SetItem(ret, nn, PyLong_FromLong(i * ((PyIntObject*)v)->ob_ival)); - else - PyList_SetItem(ret, nn, v); + PyList_SetItem(ret, nn, v); } return ret; } @@ -2898,7 +2890,7 @@ return NULL; if (PyType_Ready(&ArrayBasetype) < 0) - return; + return NULL; PyModule_AddObject(m, "ArrayType", (PyObject *)&Arraytype); PyModule_AddObject(m, "array", (PyObject *)&Arraytype); PyModule_AddObject(m, "arraybase", (PyObject *)&ArrayBasetype); diff --git a/pypy/module/itertools/interp_itertools.py b/pypy/module/itertools/interp_itertools.py --- a/pypy/module/itertools/interp_itertools.py +++ b/pypy/module/itertools/interp_itertools.py @@ -844,7 +844,7 @@ def __init__(self, space): self.w_next = None self.w_obj = None - + def reduce_w(self, space): list_w = [] node = self @@ -912,7 +912,7 @@ def copy_w(self): space = self.space - tee_iter = W_TeeIterable(space, self.w_iterator, self.chained_list) + tee_iter = W_TeeIterable(space, self.w_iterator, self.w_chained_list) return space.wrap(tee_iter) def reduce_w(self): @@ -921,7 +921,7 @@ self.space.newtuple([ self.w_iterator, self.w_chained_list]) - ]) + ]) def setstate_w(self, w_state): state = self.space.unpackiterable(w_state) num_args = len(state) diff --git a/pypy/module/itertools/test/test_itertools.py b/pypy/module/itertools/test/test_itertools.py --- a/pypy/module/itertools/test/test_itertools.py +++ b/pypy/module/itertools/test/test_itertools.py @@ -585,12 +585,12 @@ assert list(b) == ['a', 'b', 'c'] assert list(c) == ['a', 'b', 'c'] a, = itertools.tee('abc', 1) - x = a.next() + x = next(a) assert x == 'a' b = a.__copy__() - x = a.next() + x = next(a) assert x == 'b' - x = b.next() + x = next(b) assert x == 'b' def test_tee_function_uses_copy(self): _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit