Author: Matti Picus <matti.pi...@gmail.com>
Branch: cpyext-obj-stealing
Changeset: r91145:ae8d9aacb75e
Date: 2017-04-28 16:13 +0300
http://bitbucket.org/pypy/pypy/changeset/ae8d9aacb75e/

Log:    test shows that w_list.getitem returns a new PyObject with wrong
        refcount

diff --git a/pypy/module/cpyext/test/test_listobject.py 
b/pypy/module/cpyext/test/test_listobject.py
--- a/pypy/module/cpyext/test/test_listobject.py
+++ b/pypy/module/cpyext/test/test_listobject.py
@@ -243,9 +243,10 @@
                 tmp = PyList_GET_ITEM(o, 0);
                 // XXX should tmp be the original i2?
                 //     use CPyListStrategy?
-                if (strcmp(PyString_AsString(tmp), PyString_AsString(i2))) 
+                if ((Py_REFCNT(tmp) != Py_REFCNT(i2))) 
                 {
-                    sprintf(errbuffer, "GETITEM did not return i2");
+                    sprintf(errbuffer, "GETITEM return (%ld) and i2 
(%ld)refcounts"
+                            " unequal", (long)Py_REFCNT(tmp), 
(long)Py_REFCNT(i2));
                     PyErr_SetString(PyExc_AssertionError, errbuffer); 
                     return NULL;
                 }
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to