[pypy-commit] pypy default: Fix another test using PyString_Concat() in a way that is now

arigo pypy.commits at gmail.com
Sun May 1 05:49:31 EDT 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r84093:f05e9998737c
Date: 2016-05-01 11:49 +0200
http://bitbucket.org/pypy/pypy/changeset/f05e9998737c/

Log:	Fix another test using PyString_Concat() in a way that is now
	crashing---and wrong according to the CPython documentation

diff --git a/pypy/module/cpyext/test/test_bytesobject.py b/pypy/module/cpyext/test/test_bytesobject.py
--- a/pypy/module/cpyext/test/test_bytesobject.py
+++ b/pypy/module/cpyext/test/test_bytesobject.py
@@ -145,6 +145,7 @@
              """
                 PyObject ** v;
                 PyObject * left = PyTuple_GetItem(args, 0);
+                Py_INCREF(left);    /* the reference will be stolen! */
                 v = &left;
                 PyString_Concat(v, PyTuple_GetItem(args, 1));
                 return *v;


More information about the pypy-commit mailing list