Author: Richard Plangger <[email protected]>
Branch: py3k
Changeset: r87590:5f31b9581615
Date: 2016-10-04 17:18 +0200
http://bitbucket.org/pypy/pypy/changeset/5f31b9581615/
Log: restore the multiply operation in the switched nb_multiply
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
@@ -2373,12 +2373,14 @@
{
int nn;
int n = PyList_Size(obj1);
- PyObject *v = getarrayitem(obj2, 0);
+ PyObject * lhs, * out;
+ PyObject * rhs = getarrayitem(obj2, 0);
PyObject * ret = PyList_New(n);
for (nn = 0; nn < n; nn++)
{
- v = PyList_GetItem(obj1, nn);
- PyList_SetItem(ret, nn, v);
+ lhs = PyList_GetItem(obj1, nn);
+ out = lhs->ob_type->tp_as_number->nb_multiply(lhs, rhs);
+ PyList_SetItem(ret, nn, out);
}
return ret;
}
@@ -2386,12 +2388,14 @@
{
int nn;
int n = PyList_Size(obj2);
- PyObject *v = getarrayitem(obj1, 0);
+ PyObject * rhs, * out;
+ PyObject * lhs = getarrayitem(obj1, 0);
PyObject * ret = PyList_New(n);
for (nn = 0; nn < n; nn++)
{
- v = PyList_GetItem(obj2, nn);
- PyList_SetItem(ret, nn, v);
+ rhs = PyList_GetItem(obj2, nn);
+ out = lhs->ob_type->tp_as_number->nb_multiply(lhs, rhs);
+ PyList_SetItem(ret, nn, out);
}
return ret;
}
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit