[pypy-commit] pypy py3k: Fix refcount issue in cpython3 test: this object's reference was

amauryfa noreply at buildbot.pypy.org
Mon Feb 16 10:41:34 CET 2015


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: py3k
Changeset: r75916:745619bed083
Date: 2015-02-16 10:40 +0100
http://bitbucket.org/pypy/pypy/changeset/745619bed083/

Log:	Fix refcount issue in cpython3 test: this object's reference was
	already "stolen" by a PyTuple_SET_ITEM above.

diff --git a/lib_pypy/_testcapimodule.c b/lib_pypy/_testcapimodule.c
--- a/lib_pypy/_testcapimodule.c
+++ b/lib_pypy/_testcapimodule.c
@@ -808,7 +808,7 @@
         return raiseTestError("test_L_code",
             "L code returned wrong value for long 42");
 
-    Py_DECREF(num);
+    /* Py_DECREF(num);  <== CPython bug */
     num = PyLong_FromLong(42);
     if (num == NULL)
         return NULL;
@@ -990,7 +990,7 @@
         return raiseTestError("test_k_code",
             "k code returned wrong value for long 0xFFF...FFF");
 
-    Py_DECREF(num);
+    /* Py_DECREF(num);  <== CPython bug */
     num = PyLong_FromString("-FFFFFFFF000000000000000042", NULL, 16);
     if (num == NULL)
         return NULL;


More information about the pypy-commit mailing list