Author: Ronan Lamy <[email protected]>
Branch: cpyext-leakchecking
Changeset: r92095:7b5f5263c9de
Date: 2017-08-06 02:18 +0100
http://bitbucket.org/pypy/pypy/changeset/7b5f5263c9de/
Log: Fix tests for MSVC
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
@@ -1864,11 +1864,12 @@
if (PyList_Check(obj1) && ((arrayobject*)obj2)->ob_descr->typecode == 'i'
&& Py_SIZE(obj2) == 1)
{
int ii, nn;
+ PyObject *ret;
int n = PyList_Size(obj1);
PyObject *v = getarrayitem(obj2, 0);
int i = ((PyIntObject*)v)->ob_ival;
Py_DECREF(v);
- PyObject * ret = PyList_New(n*i);
+ ret = PyList_New(n*i);
for (ii = 0; ii < i; ii++)
for (nn = 0; nn < n; nn++)
{
@@ -1881,11 +1882,12 @@
else if (PyList_Check(obj2) && ((arrayobject*)obj1)->ob_descr->typecode ==
'i' && Py_SIZE(obj1) == 1)
{
int ii, nn;
+ PyObject *ret;
int n = PyList_Size(obj2);
PyObject *v = getarrayitem(obj1, 0);
int i = ((PyIntObject*)v)->ob_ival;
Py_DECREF(v);
- PyObject * ret = PyList_New(n*i);
+ ret = PyList_New(n*i);
for (ii = 0; ii < i; ii++)
for (nn = 0; nn < n; nn++)
{
@@ -1918,11 +1920,12 @@
if (PyList_Check(obj1) && ((arrayobject*)obj2)->ob_descr->typecode == 'i'
&& Py_SIZE(obj2) == 1)
{
int nn;
+ PyObject *ret;
int n = PyList_Size(obj1);
PyObject *v = getarrayitem(obj2, 0);
int i = ((PyIntObject*)v)->ob_ival;
Py_DECREF(v);
- PyObject * ret = PyList_New(n);
+ ret = PyList_New(n);
for (nn = 0; nn < n; nn++)
{
v = PyList_GetItem(obj1, nn);
@@ -1939,11 +1942,12 @@
else if (PyList_Check(obj2) && ((arrayobject*)obj1)->ob_descr->typecode ==
'i' && Py_SIZE(obj1) == 1)
{
int nn;
+ PyObject *ret;
int n = PyList_Size(obj2);
PyObject *v = getarrayitem(obj1, 0);
int i = ((PyIntObject*)v)->ob_ival;
Py_DECREF(v);
- PyObject * ret = PyList_New(n);
+ ret = PyList_New(n);
for (nn = 0; nn < n; nn++)
{
v = PyList_GetItem(obj2, nn);
diff --git a/pypy/module/cpyext/test/test_dictobject.py
b/pypy/module/cpyext/test/test_dictobject.py
--- a/pypy/module/cpyext/test/test_dictobject.py
+++ b/pypy/module/cpyext/test/test_dictobject.py
@@ -214,7 +214,7 @@
("keys_and_values", "METH_O",
'''
Py_ssize_t pos = 0;
- PyObject *key, *value;
+ PyObject *key, *value, *values;
PyObject* keys = PyList_New(0);
while (PyDict_Next(args, &pos, &key, NULL))
{
@@ -225,7 +225,7 @@
}
}
pos = 0;
- PyObject* values = PyList_New(0);
+ values = PyList_New(0);
while (PyDict_Next(args, &pos, NULL, &value))
{
if (PyList_Append(values, value) < 0)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit