Author: Manuel Jacob <m...@manueljacob.de> Branch: py3k Changeset: r82461:fa1b4e83847a Date: 2016-02-23 16:59 +0100 http://bitbucket.org/pypy/pypy/changeset/fa1b4e83847a/
Log: hg merge 1df21a900a84 diff --git a/pypy/module/cpyext/bytesobject.py b/pypy/module/cpyext/bytesobject.py --- a/pypy/module/cpyext/bytesobject.py +++ b/pypy/module/cpyext/bytesobject.py @@ -8,7 +8,6 @@ PyObject, PyObjectP, Py_DecRef, make_ref, from_ref, track_reference, make_typedescr, get_typedescr) - ## ## Implementation of PyBytesObject ## ================================ @@ -144,8 +143,6 @@ ref_str.c_buffer = rffi.str2charp(s) return ref_str.c_buffer -#_______________________________________________________________________ - @cpython_api([PyObject, rffi.CCHARPP, rffi.CArrayPtr(Py_ssize_t)], rffi.INT_real, error=-1) def PyBytes_AsStringAndSize(space, ref, buffer, length): if not PyBytes_Check(space, ref): @@ -228,9 +225,9 @@ if w_newpart is None or not PyBytes_Check(space, ref[0]) or \ not PyBytes_Check(space, w_newpart): - Py_DecRef(space, ref[0]) - ref[0] = lltype.nullptr(PyObject.TO) - return + Py_DecRef(space, ref[0]) + ref[0] = lltype.nullptr(PyObject.TO) + return w_str = from_ref(space, ref[0]) w_newstr = space.add(w_str, w_newpart) Py_DecRef(space, ref[0]) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit