Author: Armin Rigo <[email protected]>
Branch: cpyext-gc-support-2
Changeset: r82290:5db4332316d0
Date: 2016-02-16 18:18 +0100
http://bitbucket.org/pypy/pypy/changeset/5db4332316d0/
Log: fix test
diff --git a/pypy/module/cpyext/test/test_tupleobject.py
b/pypy/module/cpyext/test/test_tupleobject.py
--- a/pypy/module/cpyext/test/test_tupleobject.py
+++ b/pypy/module/cpyext/test/test_tupleobject.py
@@ -1,7 +1,6 @@
import py
from pypy.module.cpyext.pyobject import PyObject, PyObjectP, make_ref, from_ref
-from pypy.module.cpyext.pyobject import as_pyobj
from pypy.module.cpyext.tupleobject import PyTupleObject
from pypy.module.cpyext.test.test_api import BaseApiTest
from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase
@@ -25,7 +24,9 @@
ar = lltype.malloc(PyObjectP.TO, 1, flavor='raw')
py_tuple = api.PyTuple_New(3)
- rffi.cast(PyTupleObject, py_tuple).c_ob_item[0] = as_pyobj(space, w_42)
+ # inside py_tuple is an array of "PyObject *" items which each hold
+ # a reference
+ rffi.cast(PyTupleObject, py_tuple).c_ob_item[0] = make_ref(space, w_42)
ar[0] = py_tuple
api._PyTuple_Resize(ar, 2)
w_tuple = from_ref(space, ar[0])
@@ -34,7 +35,7 @@
api.Py_DecRef(ar[0])
py_tuple = api.PyTuple_New(3)
- rffi.cast(PyTupleObject, py_tuple).c_ob_item[0] = as_pyobj(space, w_42)
+ rffi.cast(PyTupleObject, py_tuple).c_ob_item[0] = make_ref(space, w_42)
ar[0] = py_tuple
api._PyTuple_Resize(ar, 10)
w_tuple = from_ref(space, ar[0])
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit