diff -r 0c1b091fb92b pypy/module/cpyext/test/test_bufferobject.py --- a/pypy/module/cpyext/test/test_bufferobject.py Sun Apr 08 12:03:19 2018 +0300 +++ b/pypy/module/cpyext/test/test_bufferobject.py Sun Apr 08 11:07:48 2018 +0200 @@ -71,17 +71,15 @@ module = self.import_extension('foo', [ ("test_mod", 'METH_VARARGS', """ - PyObject *obj, *collect, *tup; + PyObject *obj; Py_buffer bp; - if (!PyArg_ParseTuple(args, "OO", &obj, &collect)) + if (!PyArg_ParseTuple(args, "O", &obj)) return NULL; assert(obj); if (PyObject_GetBuffer(obj, &bp, PyBUF_SIMPLE) == -1) return NULL; - - tup = PyTuple_New(0); /* for collect() */ if (((unsigned char*)bp.buf)[0] != '0') { PyErr_Format(PyExc_ValueError, "mismatch: 0x%x [%x %x %x %x...] instead of '0' (got len=%d)", @@ -92,12 +90,10 @@ ((unsigned char*)bp.buf)[4], bp.len); PyBuffer_Release(&bp); - Py_DECREF(tup); return NULL; } PyBuffer_Release(&bp); - Py_DECREF(tup); Py_RETURN_NONE; """), ]) @@ -114,7 +110,7 @@ block = getdata(bufsize) assert block[:8] == '01234567' try: - module.test_mod(block, gc.collect) + module.test_mod(block) except ValueError as e: print("%s at it=%d" % (e, j)) assert False